[update] - baseURL and Image Download URL

This commit is contained in:
Swapnil155
2024-06-10 10:14:14 +00:00
parent 67a0374e54
commit c90f340b6d
30 changed files with 71 additions and 41 deletions

View File

@@ -37,6 +37,7 @@ import Header from "../../Components/Header";
import CommunityBannerCard from "../../Pages/Community/CommunityBannerCard";
import BannerMainCard from "./BannerMainCard";
import ToastBox from "../ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const BannerEdit = ({isLoading, data, updateBanner, navigateTo, refetch, center}) => {
const { id } = useParams();
@@ -78,7 +79,7 @@ const BannerEdit = ({isLoading, data, updateBanner, navigateTo, refetch, center}
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.banner_image}`
`${API_URL}/${data?.data?.banner_image}`
);
setValue("heading", data?.data?.Heading);
setValue("sub_heading", data?.data?.sub_heading);

View File

@@ -30,6 +30,7 @@ import {
WarningIcon,
} from "@chakra-ui/icons";
import ToastBox from "../ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const BannerCommunity = ({
dataArray,
@@ -162,7 +163,7 @@ const BannerCommunity = ({
h={14}
rounded={4}
objectFit="cover"
src={`https://rubix.betadelivery.com/${item.banner_image}`}
src={`${API_URL}/${item.banner_image}`}
alt="Dan Abramov"
/>
),

View File

@@ -16,6 +16,7 @@ import {
VStack,
} from "@chakra-ui/react";
import BannerMainCard from "./BannerMainCard";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const BannerView = ({data, isLoading, editLink, center}) => {
const banner = data?.data;
@@ -64,12 +65,12 @@ const BannerView = ({data, isLoading, editLink, center}) => {
rounded={8}
w={500}
h={240}
src={`https://rubix.betadelivery.com/${banner?.banner_image}`}
src={`${API_URL}/${banner?.banner_image}`}
alt="Selected Image"
/> */}
<BannerMainCard
imgLink={`https://rubix.betadelivery.com/${banner?.banner_image}`}
imgLink={`${API_URL}/${banner?.banner_image}`}
heading={banner?.Heading}
subHeading={banner?.sub_heading}
buttonTitle={banner?.CTO_button_title}

View File

@@ -54,6 +54,7 @@ import Header from "../../Components/Header";
import ToastBox from "../../Components/ToastBox";
import TabularView from "../../Components/TabularView/TabularView";
import { TABLE_PAGINATION } from "../../Constants/Paginations";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const BlogsAndArticles = () => {
// ====================================================[Hooks]===================================================================
@@ -159,7 +160,7 @@ const BlogsAndArticles = () => {
<Avatar
size="sm"
name="KC Reddy"
src={`https://rubix.betadelivery.com/${item.profile_image}`}
src={`${API_URL}/${item.profile_image}`}
/>
<span className="d-flex flex-column">
<Text

View File

@@ -32,6 +32,7 @@ import { motion } from "framer-motion";
import Loader01 from "../../Components/Loaders/Loader01";
import Header from "../../Components/Header";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditBlogsAndArticles = () => {
const { id } = useParams();
@@ -76,9 +77,9 @@ const EditBlogsAndArticles = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(`https://rubix.betadelivery.com/${blog?.profile_image}`);
setSelectedImage(`${API_URL}/${blog?.profile_image}`);
setSelectedImageLarge(
`https://rubix.betadelivery.com/${blog?.content_image_large}`
`${API_URL}/${blog?.content_image_large}`
);
setValue("author_name", blog?.author_name);
setValue("author_designation", blog?.author_designation);

View File

@@ -14,6 +14,7 @@ import { useGetBlogByIdQuery } from "../../Services/api.service";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import { OPACITY_ON_LOAD } from "../../Layout/animations";
import Header from "../../Components/Header";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewBlogsAndArticles = () => {
const { id } = useParams();
@@ -67,7 +68,7 @@ const ViewBlogsAndArticles = () => {
rounded={8}
w={500}
h={240}
src={`https://rubix.betadelivery.com/${blog?.content_image_large}`}
src={`${API_URL}/${blog?.content_image_large}`}
alt="Selected Image"
/>
{/* <Button
@@ -192,7 +193,7 @@ const ViewBlogsAndArticles = () => {
rounded={8}
w={214}
h={240}
src={`https://rubix.betadelivery.com/${blog?.profile_image}`}
src={`${API_URL}/${blog?.profile_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -4,6 +4,7 @@ import { Text, SimpleGrid, Card, Image, Box, Flex } from "@chakra-ui/react";
// import map from "../../assets/images/map-pin.png";
import linkedin from "../../assets/linkedin.png";
import { Link } from "react-router-dom";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const CommCard = ({ id, imageUrl, name, jobTitle, description, linkdin }) => {
return (
@@ -32,7 +33,7 @@ const CommCard = ({ id, imageUrl, name, jobTitle, description, linkdin }) => {
},
}}
>
<Image src={`https://rubix.betadelivery.com/${imageUrl}`} />
<Image src={`${API_URL}/${imageUrl}`} />
</Text>
<Text
position={"relative"}

View File

@@ -56,6 +56,7 @@ import CommunityBannerCard from "./CommunityBannerCard";
import Header from "../../Components/Header";
import { TABLE_PAGINATION } from "../../Constants/Paginations";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const Community = () => {
// ====================================================[Hooks]===================================================================
@@ -171,7 +172,7 @@ const Community = () => {
<Avatar
size="sm"
name="KC Reddy"
src={`https://rubix.betadelivery.com/${item.profile_image}`}
src={`${API_URL}/${item.profile_image}`}
/>
<span className="d-flex flex-column">
<Text
@@ -343,7 +344,7 @@ const Community = () => {
w={"100%"}
borderRadius={6}/> :
<Box
bgImage={`https://rubix.betadelivery.com/${banner?.banner_image}`}
bgImage={`${API_URL}/${banner?.banner_image}`}
bgSize="cover"
bgPosition="center"
cursor={'pointer'}

View File

@@ -13,6 +13,7 @@ import {
import React from "react";
import WebButton from "../../Components/WebButton";
import { formatDate } from "../../Components/Functions/UTCConvertor";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const CommunityBannerCard = ({
bgImage,
@@ -46,7 +47,7 @@ const CommunityBannerCard = ({
// border={"1px solid #9B4651"}
borderRadius={'sm'}
overflow={"hidden"}
bgImage={`https://rubix.betadelivery.com/${bgImage}`}
bgImage={`${API_URL}/${bgImage}`}
bgSize="cover"
bgPosition="center"
// backgroundColor={status ? "#ffe5ea": '#ffffff'}
@@ -164,7 +165,7 @@ const CommunityBannerCard = ({
rounded={"md"}
w={130}
h={"75px"}
src={`https://rubix.betadelivery.com/${bgImage}`}
src={`${API_URL}/${bgImage}`}
/>
</Box> */}
</Box>

View File

@@ -32,6 +32,7 @@ import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import fallbackImage from "../../assets/fallBackImage.png";
import Header from "../../Components/Header";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ComunityEditPage = () => {
const { id } = useParams();
@@ -62,7 +63,7 @@ const ComunityEditPage = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.profile_image}`
`${API_URL}/${data?.data?.profile_image}`
);
setValue("member_name", data?.data?.member_name);
setValue("designation", data?.data?.designation);

View File

@@ -9,6 +9,7 @@ import { Box, Divider, Image, Tag } from "@chakra-ui/react";
import Header from "../../Components/Header";
import { OPACITY_ON_LOAD } from "../../Layout/animations";
import { formatDate } from "../../Components/Functions/UTCConvertor";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ComunityViewPage = () => {
const { id } = useParams();
@@ -59,7 +60,7 @@ const ComunityViewPage = () => {
rounded={8}
w={214}
h={240}
src={`https://rubix.betadelivery.com/${data?.data?.profile_image}`}
src={`${API_URL}/${data?.data?.profile_image}`}
alt="Selected Image"
/>
{/* <Button

View File

@@ -29,6 +29,7 @@ import { TiWarning } from "react-icons/ti";
import { motion } from "framer-motion";
import Loader01 from "../../Components/Loaders/Loader01";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditEvents = () => {
const { id } = useParams();
@@ -63,7 +64,7 @@ const EditEvents = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.banner_image}`
`${API_URL}/${data?.data?.banner_image}`
);
setValue("title", data?.data?.title);
setValue("content", data?.data?.content);

View File

@@ -6,6 +6,7 @@ import FullscreenLoaders from '../../Components/Loaders/FullscreenLoaders';
import { OPACITY_ON_LOAD } from '../../Layout/animations';
import Header from '../../Components/Header';
import { formatDate } from '../../Components/Functions/UTCConvertor';
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewEvents = () => {
const { id } = useParams();
@@ -61,7 +62,7 @@ const ViewEvents = () => {
objectFit='cover'
w={500}
h={240}
src={`https://rubix.betadelivery.com/${events?.banner_image}`}
src={`${API_URL}/${events?.banner_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -11,6 +11,7 @@ import { AttachmentIcon } from "@chakra-ui/icons";
import extractFilename from "../../Components/Functions/FileNameAlter";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import pdf from "../../assets/pdfscreen.png";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewFaq = () => {
const { id } = useParams();
@@ -20,7 +21,7 @@ const ViewFaq = () => {
const viewFaq = data?.data;
// console.log(viewPolicy?.banner_image);
// console.log(`https://rubix.betadelivery.com/${viewPolicy?.banner_image}`);
// console.log(`${API_URL}/${viewPolicy?.banner_image}`);
if (isLoading) {
return <FullscreenLoaders />;
@@ -49,7 +50,7 @@ const ViewFaq = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${viewPolicy?.banner_image}`}
src={`${API_URL}/${viewPolicy?.banner_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -31,6 +31,7 @@ import { formatDate } from "../../Components/Functions/UTCConvertor";
import { TiWarning } from "react-icons/ti";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditNews = () => {
const { id } = useParams();
@@ -62,7 +63,7 @@ const EditNews = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.banner_image}`
`${API_URL}/${data?.data?.banner_image}`
);
setValue("title", data?.data?.title);
setValue("meta_description", data?.data?.meta_description);

View File

@@ -9,6 +9,7 @@ import {
import { useNavigate, useParams } from "react-router-dom";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import { formatDate } from "../../Components/Functions/UTCConvertor";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewNews = () => {
const { id } = useParams();
@@ -64,7 +65,7 @@ const ViewNews = () => {
objectFit='cover'
w={500}
h={240}
src={`https://rubix.betadelivery.com/${news?.banner_image}`}
src={`${API_URL}/${news?.banner_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -34,6 +34,7 @@ import Loader01 from "../../Components/Loaders/Loader01";
import { motion } from "framer-motion";
import ToastBox from "../../Components/ToastBox";
import ReactQuill from "react-quill";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditPartner = () => {
const { id } = useParams();
@@ -69,7 +70,7 @@ const EditPartner = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.company_logo}`
`${API_URL}/${data?.data?.company_logo}`
);
setValue("website_link", data?.data?.website_link);
setValue("description", data?.data?.description);

View File

@@ -11,6 +11,7 @@ import { AttachmentIcon } from "@chakra-ui/icons";
import extractFilename from "../../Components/Functions/FileNameAlter";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import pdf from "../../assets/pdfscreen.png";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewPartner = () => {
const { id } = useParams();
@@ -20,7 +21,7 @@ const ViewPartner = () => {
const viewPolicy = data?.data;
console.log(viewPolicy);
console.log(`https://rubix.betadelivery.com/${viewPolicy?.company_logo}`);
console.log(`${API_URL}/${viewPolicy?.company_logo}`);
if (isLoading) {
return <FullscreenLoaders />;
@@ -53,7 +54,7 @@ const ViewPartner = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${viewPolicy?.company_logo}`}
src={`${API_URL}/${viewPolicy?.company_logo}`}
alt="Selected Image"
/>
</Box>

View File

@@ -32,6 +32,7 @@ import Loader01 from "../../Components/Loaders/Loader01";
import { motion } from "framer-motion";
import ToastBox from "../../Components/ToastBox";
import ReactQuill from "react-quill";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditPolicy = () => {
const { id } = useParams();
@@ -67,7 +68,7 @@ const EditPolicy = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.banner_image}`
`${API_URL}/${data?.data?.banner_image}`
);
setValue("title", data?.data?.title);
setValue("content", data?.data?.content);

View File

@@ -8,6 +8,7 @@ import { AttachmentIcon } from "@chakra-ui/icons";
import extractFilename from "../../Components/Functions/FileNameAlter";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import pdf from "../../assets/pdfscreen.png";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewPolicy = () => {
const { id } = useParams();
@@ -17,7 +18,7 @@ const ViewPolicy = () => {
const viewPolicy = data?.data;
console.log(viewPolicy?.banner_image);
console.log(`https://rubix.betadelivery.com/${viewPolicy?.banner_image}`);
console.log(`${API_URL}/${viewPolicy?.banner_image}`);
if (isLoading) {
return <FullscreenLoaders />;
@@ -50,7 +51,7 @@ const ViewPolicy = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${viewPolicy?.banner_image}`}
src={`${API_URL}/${viewPolicy?.banner_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -35,6 +35,7 @@ import Loader01 from "../../Components/Loaders/Loader01";
import { motion } from "framer-motion";
import ToastBox from "../../Components/ToastBox";
import ReactQuill from "react-quill";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditTerms = () => {
const { id } = useParams();
@@ -70,7 +71,7 @@ const EditTerms = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.banner_image}`
`${API_URL}/${data?.data?.banner_image}`
);
setValue("title", data?.data?.title);
setValue("content", data?.data?.content);

View File

@@ -8,6 +8,7 @@ import { AttachmentIcon } from "@chakra-ui/icons";
import extractFilename from "../../Components/Functions/FileNameAlter";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import pdf from "../../assets/pdfscreen.png";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewTerms = () => {
const { id } = useParams();
@@ -17,7 +18,7 @@ const ViewTerms = () => {
const viewTerms = data?.data;
console.log(viewTerms?.banner_image);
console.log(`https://rubix.betadelivery.com/${viewTerms?.banner_image}`);
console.log(`${API_URL}/${viewTerms?.banner_image}`);
if (isLoading) {
return <FullscreenLoaders />;
@@ -50,7 +51,7 @@ const ViewTerms = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${viewTerms?.banner_image}`}
src={`${API_URL}/${viewTerms?.banner_image}`}
alt="Selected Image"
/>
</Box>

View File

@@ -35,6 +35,7 @@ import { motion } from "framer-motion";
import Loader01 from "../../Components/Loaders/Loader01";
import Header from "../../Components/Header";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditUseCase = () => {
const { id } = useParams();
@@ -78,9 +79,9 @@ const EditUseCase = () => {
useEffect(() => {
if (data?.data) {
setSelectedImage(`https://rubix.betadelivery.com/${blog?.icon}`);
setSelectedImage(`${API_URL}/${blog?.icon}`);
setSelectedImageLarge(
`https://rubix.betadelivery.com/${blog?.bannerImage}`
`${API_URL}/${blog?.bannerImage}`
);
setValue("meta_description", blog?.meta_description);
setValue("title", blog?.title);

View File

@@ -36,6 +36,7 @@ import Header from "../../Components/Header";
import { TABLE_PAGINATION } from "../../Constants/Paginations";
import TabularView from "../../Components/TabularView/TabularView";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const Usecase = () => {
// ====================================================[Hooks]===================================================================
@@ -143,7 +144,7 @@ const Usecase = () => {
w={"35px"}
h={"35px"}
rounded={"full"}
src={`https://rubix.betadelivery.com/${item?.icon}`}
src={`${API_URL}/${item?.icon}`}
/>
<Text as={"span"}>{item?.title}</Text>
</Box>

View File

@@ -8,6 +8,7 @@ import {
import { useNavigate, useParams } from "react-router-dom";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import { formatDate } from "../../Components/Functions/UTCConvertor";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewUseCase = () => {
const { id } = useParams();
@@ -59,7 +60,7 @@ const ViewUseCase = () => {
objectFit='cover'
w={"100px"}
h={"100px"}
src={`https://rubix.betadelivery.com/${usecase?.icon}`}
src={`${API_URL}/${usecase?.icon}`}
alt="Selected Image"
/>
</Box>
@@ -81,7 +82,7 @@ const ViewUseCase = () => {
objectFit='cover'
w={500}
h={240}
src={`https://rubix.betadelivery.com/${usecase?.bannerImage}`}
src={`${API_URL}/${usecase?.bannerImage}`}
alt="Selected Image"
/>
</Box>

View File

@@ -30,6 +30,7 @@ import Loader01 from "../../Components/Loaders/Loader01";
import { motion } from "framer-motion";
import { TiWarning } from "react-icons/ti";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditVideos = () => {
const { id } = useParams();
@@ -62,7 +63,7 @@ const EditVideos = () => {
useEffect(() => {
if (data?.data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.data?.thumbnail}`
`${API_URL}/${data?.data?.data?.thumbnail}`
);
setValue("title", data?.data?.data?.title);
setValue("description", data?.data?.data?.description);

View File

@@ -5,6 +5,7 @@ import { useGetVideosByIdQuery } from "../../Services/api.service";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import Header from "../../Components/Header";
import { OPACITY_ON_LOAD } from "../../Layout/animations";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewVideos = () => {
const { id } = useParams();
@@ -60,7 +61,7 @@ const ViewVideos = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${videos?.thumbnail}`}
src={`${API_URL}/${videos?.thumbnail}`}
alt="Selected Image"
/>
</Box>

View File

@@ -32,6 +32,7 @@ import extractFilename from "../../Components/Functions/FileNameAlter";
import Loader01 from "../../Components/Loaders/Loader01";
import { motion } from "framer-motion";
import ToastBox from "../../Components/ToastBox";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const EditWhitepaper = () => {
const { id } = useParams();
@@ -60,7 +61,7 @@ const EditWhitepaper = () => {
useEffect(() => {
if (data?.data?.data) {
setSelectedImage(
`https://rubix.betadelivery.com/${data?.data?.data?.bannerImage}`
`${API_URL}/${data?.data?.data?.bannerImage}`
);
setValue("title", data?.data?.data?.title);
setValue("image", data?.data?.data?.image);

View File

@@ -8,6 +8,7 @@ import { AttachmentIcon } from "@chakra-ui/icons";
import extractFilename from "../../Components/Functions/FileNameAlter";
import FullscreenLoaders from "../../Components/Loaders/FullscreenLoaders";
import pdf from "../../assets/pdfscreen.png"
const API_URL = import.meta.env.VITE_API_BASE_URL;
const ViewWhitePaper = () => {
const { id } = useParams();
@@ -60,7 +61,7 @@ const ViewWhitePaper = () => {
objectFit="cover"
w={500}
h={240}
src={`https://rubix.betadelivery.com/${whitepaper?.bannerImage}`}
src={`${API_URL}/${whitepaper?.bannerImage}`}
alt="Selected Image"
/>
</Box>

View File

@@ -1,7 +1,8 @@
// Need to use the React-specific entry point to import createApi
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
const baseUrl = "https://rubix.betadelivery.com/api";
const API_URL = import.meta.env.VITE_API_BASE_URL;
const baseUrl = API_URL + "/api";
// Define a service using a base URL and expected endpoints
export const rubixApi = createApi({