Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
navdhi-infotech committed May 6, 2022
1 parent 50cd982 commit 7ef1c2c
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Button } from "native-base";

const ButtonHOC = ({ children, ...rest }) => {
const ButtonWrapper = ({ children, ...rest }) => {
return <Button {...rest}>{children}</Button>;
};

export default ButtonHOC;
export default ButtonWrapper;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Link, useParams } from "react-router-dom";

const LinkHOC = ({ children, ...rest }) => {
const LinkWrapper = ({ children, ...rest }) => {
return <Link {...rest}>{children}</Link>;
};

export default LinkHOC;
export default LinkWrapper;
16 changes: 8 additions & 8 deletions packages/attendance/src/pages/Attendance.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import AttendanceComponent, {
import * as studentServiceRegistry from "../services/studentServiceRegistry";
import * as classServiceRegistry from "../services/classServiceRegistry";
import moment from "moment";
import ButtonHOC from "atoms/ButtonHOC";
import LinkHOC from "atoms/LinkHOC";
import ButtonWrapper from "atoms/ButtonWrapper";
import LinkWrapper from "atoms/LinkWrapper";
import Loader from "atoms/Loader";
import FourOFour from "atoms/FourOFour";

Expand Down Expand Up @@ -106,7 +106,7 @@ export default function Attendance({ footerLinks }) {
setSearch: setSearch,
subHeading: t("ATTENDANCE_REGISTER"),
iconComponent: (
<LinkHOC
<LinkWrapper
to="/attendance/report"
style={{ color: "rgb(63, 63, 70)", textDecoration: "none" }}
>
Expand All @@ -120,12 +120,12 @@ export default function Attendance({ footerLinks }) {
>
{t("REPORT")}
</Box>
</LinkHOC>
</LinkWrapper>
),
}}
_appBar={{ languages: manifest.languages }}
subHeader={
<LinkHOC
<LinkWrapper
to={`/students/class/${classId}`}
style={{ color: "rgb(63, 63, 70)", textDecoration: "none" }}
>
Expand All @@ -140,7 +140,7 @@ export default function Attendance({ footerLinks }) {
</VStack>
<IconByName size="sm" name="ArrowRightSLineIcon" />
</HStack>
</LinkHOC>
</LinkWrapper>
}
_subHeader={{ bg: "attendanceCard.500" }}
_footer={footerLinks}
Expand Down Expand Up @@ -179,7 +179,7 @@ export default function Attendance({ footerLinks }) {
}
/>

<ButtonHOC
<ButtonWrapper
variant="ghost"
colorScheme="button"
endIcon={
Expand All @@ -192,7 +192,7 @@ export default function Attendance({ footerLinks }) {
onPress={(e) => setIsEditDisabled(!isEditDisabled)}
>
{isEditDisabled ? t("EDIT") : t("CANCEL")}
</ButtonHOC>
</ButtonWrapper>
</HStack>
</Box>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import moment from "moment";
import { Box, HStack, Text, VStack } from "native-base";
import { useTranslation } from "react-i18next";
import { IconByName } from "@shiksha/common-lib";
import ButtonHOC from "atoms/ButtonHOC";
import ButtonWrapper from "atoms/ButtonWrapper";

const Message = ({ item, isDisableRetry }) => {
const { t } = useTranslation();
Expand All @@ -24,9 +24,9 @@ const Message = ({ item, isDisableRetry }) => {
</Text>
</HStack>
{item.status !== "Send" && !isDisableRetry ? (
<ButtonHOC variant="ghost" colorScheme="button" py="0">
<ButtonWrapper variant="ghost" colorScheme="button" py="0">
{t("RETRY")}
</ButtonHOC>
</ButtonWrapper>
) : (
""
)}
Expand Down
14 changes: 7 additions & 7 deletions packages/attendance/src/pages/sms/MessageHistory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as studentServiceRegistry from "../../../services/studentServiceRegistr
import { calendar } from "../../../components/AttendanceComponent";
import CalendarBar from "../../../components/CalendarBar";
import manifest from "../../../manifest.json";
import ButtonHOC from "atoms/ButtonHOC";
import ButtonWrapper from "atoms/ButtonWrapper";
import { sms } from "./assets";
import CalendarComponent from "./Molecule/CalendarComponent";
import Message from "./Molecule/Message";
Expand Down Expand Up @@ -75,7 +75,7 @@ export default function MessageHistory({ footerLinks }) {
_box={{ p: 0, bg: "transparent" }}
/>
<Stack>
<ButtonHOC
<ButtonWrapper
rounded={"full"}
colorScheme="button"
variant="outline"
Expand All @@ -96,7 +96,7 @@ export default function MessageHistory({ footerLinks }) {
? t("WEEK_VIEW")
: t("TODAY_VIEW")}
</Text>
</ButtonHOC>
</ButtonWrapper>
<Actionsheet
isOpen={showModal}
_backdrop={{ opacity: "0.9", bg: "gray.500" }}
Expand Down Expand Up @@ -199,15 +199,15 @@ export default function MessageHistory({ footerLinks }) {
<Box bg="white" w="100%">
<Message item={smsObject} isDisableRetry />
<Button.Group p="5">
<ButtonHOC
<ButtonWrapper
flex={1}
variant="outline"
colorScheme="button"
onPress={(e) => setShowModal(true)}
>
{smsObject?.status === "Send" ? t("RESEND") : t("RETRY")}
</ButtonHOC>
<ButtonHOC
</ButtonWrapper>
<ButtonWrapper
flex={1}
colorScheme="button"
onPress={(e) => {
Expand All @@ -216,7 +216,7 @@ export default function MessageHistory({ footerLinks }) {
_text={{ color: "white" }}
>
{t("DONE")}
</ButtonHOC>
</ButtonWrapper>
</Button.Group>
</Box>
</Actionsheet>
Expand Down
10 changes: 5 additions & 5 deletions packages/attendance/src/pages/sms/SendSMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as studentServiceRegistry from "../../services/studentServiceRegistry";
import { GetAttendance } from "../../components/AttendanceComponent";
import DayWiesBar from "../../components/CalendarBar";
import { IconByName, Layout, Collapsible } from "@shiksha/common-lib";
import ButtonHOC from "atoms/ButtonHOC";
import ButtonWrapper from "atoms/ButtonWrapper";

export default function SendSMS({ footerLinks }) {
const { t } = useTranslation();
Expand Down Expand Up @@ -228,12 +228,12 @@ export default function SendSMS({ footerLinks }) {
{t("SMS_WILL_AUTOMATICALLY_SENT")}
</Text>
<Button.Group>
<ButtonHOC variant="outline" colorScheme="button">
<ButtonWrapper variant="outline" colorScheme="button">
{t("SELECT_ALL")}
</ButtonHOC>
<ButtonHOC colorScheme="button" _text={{ color: "white" }}>
</ButtonWrapper>
<ButtonWrapper colorScheme="button" _text={{ color: "white" }}>
{t("SEND")}
</ButtonHOC>
</ButtonWrapper>
</Button.Group>
</VStack>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Button } from "native-base";

const ButtonHOC = ({ children, ...rest }) => {
const ButtonWrapper = ({ children, ...rest }) => {
return <Button {...rest}>{children}</Button>;
};

export default ButtonHOC;
export default ButtonWrapper;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Link, useParams } from "react-router-dom";

const LinkHOC = ({ children, ...rest }) => {
const LinkWrapper = ({ children, ...rest }) => {
return <Link {...rest}>{children}</Link>;
};

export default LinkHOC;
export default LinkWrapper;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { Collapsible, IconByName } from "@shiksha/common-lib";
import { HStack, Text, VStack, Stack, Box, Progress } from "native-base";
import { useTranslation } from "react-i18next";
import LinkHOC from "atoms/LinkHOC";
import LinkWrapper from "atoms/LinkWrapper";

const ClassAttendanceCard = ({ classId }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -32,7 +32,7 @@ const ClassAttendanceCard = ({ classId }) => {
</HStack>
</VStack>
</Box>
<LinkHOC
<LinkWrapper
style={{
color: "rgb(63, 63, 70)",
textDecoration: "none",
Expand All @@ -51,7 +51,7 @@ const ClassAttendanceCard = ({ classId }) => {
>
{t("ATTENDANCE_REGISTER")}
</Box>
</LinkHOC>
</LinkWrapper>

<Box
bg="white"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Suspense } from "react";
import { Collapsible } from "@shiksha/common-lib";
import { VStack, Box, FlatList } from "native-base";
import { useTranslation } from "react-i18next";
import ButtonHOC from "atoms/ButtonHOC";
import LinkHOC from "atoms/LinkHOC";
import ButtonWrapper from "atoms/ButtonWrapper";
import LinkWrapper from "atoms/LinkWrapper";

const ClassStudentsPanel = ({ classObject, students }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -33,16 +33,16 @@ const ClassStudentsPanel = ({ classObject, students }) => {
keyExtractor={(item) => item.id}
/>
</Box>
<LinkHOC
<LinkWrapper
style={{
textDecoration: "none",
}}
to={`/class/students/${classObject?.id?.replace("1-", "")}`}
>
<ButtonHOC mt="2" variant="outline" colorScheme="button">
<ButtonWrapper mt="2" variant="outline" colorScheme="button">
{t("SHOW_ALL_STUDENTS")}
</ButtonHOC>
</LinkHOC>
</ButtonWrapper>
</LinkWrapper>
</VStack>
</Collapsible>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Button } from "native-base";

const ButtonHOC = ({ children, ...rest }) => {
const ButtonWrapper = ({ children, ...rest }) => {
return <Button {...rest}>{children}</Button>;
};

export default ButtonHOC;
export default ButtonWrapper;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Link } from "native-base";

const LinkHOC = ({ children, ...rest }) => {
const LinkWrapper = ({ children, ...rest }) => {
return <Link {...rest}>{children}</Link>;
};

export default LinkHOC;
export default LinkWrapper;
20 changes: 10 additions & 10 deletions packages/student/src/pages/StudentDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Card from "../../components/students/Card";
import manifest from "../../manifest.json";
import InfoSection from "./Molecules/InfoSection";
import Section from "./Molecules/Section";
import LinkHOC from "atoms/LinkHOC";
import ButtonHOC from "atoms/ButtonHOC";
import LinkWrapper from "atoms/LinkWrapper";
import ButtonWrapper from "atoms/ButtonWrapper";

// Start editing here, save and see your changes.
export default function StudentDetails({ footerLinks }) {
Expand Down Expand Up @@ -129,7 +129,7 @@ export default function StudentDetails({ footerLinks }) {
</Suspense>
)}
<HStack space={2} justifyContent={"center"}>
<LinkHOC
<LinkWrapper
to={`/attendance/${studentObject.currentClassID}`}
style={{
textDecoration: "none",
Expand All @@ -147,8 +147,8 @@ export default function StudentDetails({ footerLinks }) {
>
{t("FULL_CLASS_ATTENDANCE")}
</Box>
</LinkHOC>
<LinkHOC
</LinkWrapper>
<LinkWrapper
href={`/students/sendSms/${studentObject.id}`}
style={{
textDecoration: "none",
Expand All @@ -167,7 +167,7 @@ export default function StudentDetails({ footerLinks }) {
>
{t("MESSAGE_HISTORY")}
</Box>
</LinkHOC>
</LinkWrapper>
</HStack>
</>
</Collapsible>
Expand All @@ -177,14 +177,14 @@ export default function StudentDetails({ footerLinks }) {
<Section
title={t("LEARNING")}
button={
<ButtonHOC
<ButtonWrapper
variant="ghost"
colorScheme="button"
endIcon={<IconByName name={"PencilLineIcon"} isDisabled />}
_text={{ fontWeight: "400" }}
>
{t("EDIT")}
</ButtonHOC>
</ButtonWrapper>
}
>
{[
Expand Down Expand Up @@ -212,14 +212,14 @@ export default function StudentDetails({ footerLinks }) {
title={t("NOTES_FEEDBACK_ON_STUDENT")}
_box={{ mb: "4", roundedBottom: "xl", shadow: 2 }}
button={
<ButtonHOC
<ButtonWrapper
variant="ghost"
colorScheme="button"
endIcon={<IconByName name={"PencilLineIcon"} isDisabled />}
_text={{ fontWeight: "400" }}
>
{t("EDIT")}
</ButtonHOC>
</ButtonWrapper>
}
>
<Box p="5">
Expand Down
6 changes: 3 additions & 3 deletions packages/student/src/pages/students/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useParams } from "react-router-dom";
import Card from "../../components/students/Card";
import manifest from "../../manifest.json";
import Collapsible from "./Molecules/Collapsible";
import ButtonHOC from "atoms/ButtonHOC";
import ButtonWrapper from "atoms/ButtonWrapper";

// Start editing here, save and see your changes.
const Student = ({ footerLinks }) => {
Expand Down Expand Up @@ -83,9 +83,9 @@ const Student = ({ footerLinks }) => {
keyExtractor={(item) => item.id}
/>
</Box>
<ButtonHOC mt="2" variant="outline" colorScheme="button">
<ButtonWrapper mt="2" variant="outline" colorScheme="button">
{t("SEE_ALL_STUDENTS")}
</ButtonHOC>
</ButtonWrapper>
</VStack>
}
/>
Expand Down

0 comments on commit 7ef1c2c

Please sign in to comment.