Skip to content

Commit

Permalink
Styling issue resolved (#33)
Browse files Browse the repository at this point in the history
* Routing issue resolved

* response key mapping changes

* Style issues fixed

* Sonar issues resolved

* coderabbitai comments resolved

* Sonar cloud issue resolved

* Sonar cloud issue resolved

* style issues fixed

* style changed
  • Loading branch information
vidyaaKhandekar authored Nov 28, 2024
1 parent f59d28f commit b7e3f27
Show file tree
Hide file tree
Showing 23 changed files with 200 additions and 269 deletions.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { useKeycloak } from "@react-keycloak/web";
import { AuthProvider } from "./utils/context/checkToken";
import "./assets/styles/App.css";
import Layout from "./components/common/layout/Layout";

function App() {
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -52,7 +53,7 @@ function App() {
if (loading) {
return (
<ChakraProvider theme={theme}>
<Loader />
<Layout loading />
</ChakraProvider>
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/assets/styles/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
}

.card-scroll {
height: 60vh;
overflow-y: scroll;
}

Expand Down Expand Up @@ -120,4 +119,4 @@ button:disabled {
color: var(--theme-color);
border: none !important;
background: none;
}
}
2 changes: 0 additions & 2 deletions src/components/ApplicationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ const ApplicationList: React.FC<ApplicationListProps> = ({
as="section"
aria-label="Applications list"
style={{
height: "500px",
overflowY: "scroll",
paddingBottom: "100px",
padding: "16px",
width: "100%",
Expand Down
4 changes: 1 addition & 3 deletions src/components/common/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Spinner, Text, VStack } from "@chakra-ui/react";
import { useTranslation } from "react-i18next";

const Loader = () => {
const { t } = useTranslation();
return (
<VStack>
<Spinner color="var(--theme-color)" />
<Text color="var(--theme-color)">{t("GENERAL_LOADING")}</Text>
<Text color="var(--theme-color)"> Loading...</Text>
</VStack>
);
};
Expand Down
12 changes: 8 additions & 4 deletions src/components/common/UploadDocumentEwallet.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { useContext, useEffect, useRef } from "react";
import OutlineButton from "./button/OutlineButton";
import { processDocuments } from "../../utils/jsHelper/helper";
import { uploadUserDocuments } from "../../services/user/User";
import { getDocumentsList, getUser } from "../../services/auth/auth";
import { AuthContext } from "../../utils/context/checkToken";
import CommonButton from "./button/Button";
import { useTranslation } from "react-i18next";

const VITE_EWALLET_ORIGIN = import.meta.env.VITE_EWALLET_ORIGIN;
const VITE_EWALLET_IFRAME_SRC = import.meta.env.VITE_EWALLET_IFRAME_SRC;
const UploadDocumentEwallet = ({ userId }) => {
console.log("userId", userId);
const { t } = useTranslation();
const { updateUserData } = useContext(AuthContext)!;
const iframeRef = useRef(null);

Expand Down Expand Up @@ -63,9 +65,11 @@ const UploadDocumentEwallet = ({ userId }) => {

return (
<div>
<OutlineButton
label="Upload Missing Document"
<CommonButton
onClick={sendMessageToIframe}
label={t("UPLOAD_DOCUMENT_EWALLET")}
mt={2}
variant="outline"
/>

<iframe
Expand Down
16 changes: 11 additions & 5 deletions src/components/common/UserDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,27 @@ const UserDetails: React.FC<UserDetailsProps> = ({ userData }) => {
label={t("USER_DETAILS_MOTHER_NAME")}
value={userData?.motherName}
/>
<Field label={t("USER_DETAILS_DOB")} value={userData?.dob} />
<Field label={t("USER_DETAILS_LAST_NAME")} value={userData?.lastName} />
</VStack>

<VStack spacing={6} align="stretch">
<HStack spacing={4}>
<Field label={t("USER_DETAILS_DOB")} value={userData?.dob} />{" "}
<Field
label={t("USER_DETAILS_DISABILITY")}
value={userData?.disabilityStatus}
/>
</HStack>
<HStack spacing={4}>
<Field label={t("USER_DETAILS_GENDER")} value={userData?.gender} />
<Field label={t("USER_DETAILS_CASTE")} value={userData?.caste} />
</HStack>

<HStack spacing={4}>
<Field label={t("USER_DETAILS_CLASS")} value={userData?.class} />
<Field
label={t("USER_DETAILS_DISABILITY")}
value={userData?.disabilityStatus}
label={t("USER_DETAILS_PREVIOUS_YEAR_MARKS")}
value={userData?.previousYearMarks}
/>
<Field label={t("USER_DETAILS_CLASS")} value={userData?.class} />
</HStack>

<HStack spacing={4}>
Expand Down
33 changes: 0 additions & 33 deletions src/components/common/button/OutlineButton.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/common/i18n.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/i18n.ts
// i18n.js
import i18n from "i18next";
import { initReactI18next } from "react-i18next";

Expand Down
72 changes: 43 additions & 29 deletions src/components/common/layout/BottomBar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React from "react";
import { Box, Flex, IconButton, Text } from "@chakra-ui/react";
import { Box, HStack, IconButton, Text } from "@chakra-ui/react";
import { FaFileAlt } from "react-icons/fa";
import { useNavigate, useLocation } from "react-router-dom";
import { MdHome } from "react-icons/md";
import { HiDocumentSearch } from "react-icons/hi";
const BottomBar: React.FC = () => {
import useDeviceSize from "./useDeviceSize";

interface FooterProps {
setRef?: (ref: HTMLDivElement | null) => void;
}
const BottomBar: React.FC<FooterProps> = ({ setRef, ...props }) => {
const { width } = useDeviceSize();
const navigate = useNavigate();
const location = useLocation();

Expand All @@ -18,24 +24,28 @@ const BottomBar: React.FC = () => {

return (
<Box
bg="#EDEFFF"
borderRadius="lg"
shadow="lg"
borderWidth="1px"
background="#fff"
position="absolute"
bottom={0}
left="50%"
transform="translateX(-50%)"
width="100%"
maxW="550px"
height="85px"
paddingBottom="8"
width={width}
bg={"white"}
position="fixed"
bottom="0"
ref={(e) => typeof setRef === "function" && setRef(e)}
{...props}
zIndex={999}
pb={2}
>
<Flex justify="space-around" align="center" py={2}>
<Flex
direction="column"
align="center"
<HStack
bg="primary.50"
alignItems="center"
borderTopWidth={"1px"}
borderTopColor={"#DDDDDD"}
shadow={"FooterShadow"}
justifyContent={"space-around"}
>
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
onClick={() => handleNavigation("/home")}
>
<IconButton
Expand All @@ -48,11 +58,13 @@ const BottomBar: React.FC = () => {
<Text fontSize="xs" color={getTabColor("/home")}>
Home
</Text>
</Flex>
</Box>

<Flex
direction="column"
align="center"
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
onClick={() => handleNavigation("/explorebenefits")}
>
<IconButton
Expand All @@ -65,11 +77,13 @@ const BottomBar: React.FC = () => {
<Text fontSize="xs" color={getTabColor("/explorebenefits")}>
Search
</Text>
</Flex>
</Box>

<Flex
direction="column"
align="center"
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
onClick={() => handleNavigation("/applicationstatus")}
>
<IconButton
Expand All @@ -82,8 +96,8 @@ const BottomBar: React.FC = () => {
<Text fontSize="xs" color={getTabColor("/applicationstatus")}>
My Applications
</Text>
</Flex>
</Flex>
</Box>
</HStack>
</Box>
);
};
Expand Down
18 changes: 4 additions & 14 deletions src/components/common/layout/Dialogue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
AccordionPanel,
AccordionIcon,
} from "@chakra-ui/react";
import OutlineButton from "../button/OutlineButton";
import CommonButton from "../button/Button";
import { useState } from "react";

Expand Down Expand Up @@ -49,17 +48,7 @@ const CommonDialogue: React.FC<CommonDialogueProps> = ({
)}
</ModalHeader>
<ModalCloseButton />
{/* modal body for upload document component */}
{/* <ModalBody className="border-bottom">
<Text mt={4} mb={6} fontWeight="500" fontSize="20px">
Please upload the required documents to proceed with completing your
profile.
</Text>
<Text mt={2} mb={2} fontWeight="normal" fontSize="17px">
Upload the relevant document in .json or XML format.
</Text>
<UploadDocuments />
</ModalBody> */}

<ModalBody className="border-bottom">
{termsAndConditions ? (
<>
Expand Down Expand Up @@ -97,10 +86,11 @@ const CommonDialogue: React.FC<CommonDialogueProps> = ({
<ModalFooter>
{termsAndConditions ? (
<>
<OutlineButton
<CommonButton
variant="outline"
onClick={onClose}
label="Deny"
disabled={!isAccordionOpen}
isDisabled={!isAccordionOpen}
/>
<Box ml={2}>
<CommonButton label="Accept" isDisabled={!isAccordionOpen} />
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/layout/HeadingText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const BackIcon: React.FC<{ onClick: () => void; iconSize?: number }> = ({
onClick={onClick}
variant="ghost"
size="sm"
bg="white"
_hover={{ bg: "white" }}
_active={{ bg: "white" }}
/>
);

Expand Down
Loading

0 comments on commit b7e3f27

Please sign in to comment.