Skip to content

Commit

Permalink
fix: i18n for module + github action for build check
Browse files Browse the repository at this point in the history
  • Loading branch information
arajput authored Apr 24, 2022
1 parent 05309cf commit 21979c9
Show file tree
Hide file tree
Showing 38 changed files with 927 additions and 836 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI/CD check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run prettier test
run: yarn format:check

# - name: Run the tests and generate coverage report
# run: yarn test

- name: Build
run: yarn build
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ package-lock.json

# production
/build

/**/build
/prod-build
.github/
/public
.min.js
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ lerna run start --scope=[module-name]
core: 'core@[window.appModules.core.url]/remoteEntry.js',
},
```
* Add entry to `modules.json`

- Add entry to `modules.json`

```
# e.g. core module is runninig on localhost:3001 then
Expand Down
2 changes: 1 addition & 1 deletion packages/attendance/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ReportDetail from "pages/reports/ReportDetail";
import CompareReport from "pages/reports/CompareReport";
import MessageHistory from "pages/sms/MessageHistory";
import SendSMS from "pages/sms/SendSMS";
import {navigationRoute} from './services/routes';
import { navigationRoute } from "./services/routes";

function App() {
const theme = extendTheme(DEFAULT_THEME);
Expand Down
11 changes: 5 additions & 6 deletions packages/attendance/src/atoms/ButtonHOC.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react'
import React from "react";
import { Button } from "native-base";

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

return <Button {...rest}>{children}</Button>
}

export default ButtonHOC
export default ButtonHOC;
26 changes: 13 additions & 13 deletions packages/attendance/src/atoms/FourOFour.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from 'react'
import React from "react";
import { Center } from "native-base";

const FourOFour = () => {
return (
<Center flex={1} px="3">
<Center
height={200}
width={{
base: 200,
lg: 400,
}}
>
404
<Center
height={200}
width={{
base: 200,
lg: 400,
}}
>
404
</Center>
</Center>
</Center>
)
}
);
};

export default FourOFour
export default FourOFour;
129 changes: 64 additions & 65 deletions packages/attendance/src/atoms/GetIcon.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,69 @@
import React from 'react'
import React from "react";
import { Box } from "native-base";
import { IconByName } from "@shiksha/common-lib";

export const GetIcon = ({ status, _box, color, _icon, type }) => {
let icon = <></>;
let iconProps = { fontSize: "xl", isDisabled: true, ..._icon };
switch (status) {
case "Present":
icon = (
<Box {..._box} color={color ? color : "present.500"}>
<IconByName
name={type === "Send" ? "MailFillIcon" : "MailForbidFillIcon"}
p="5px"
rounded="full"
_icon={{ size: "14" }}
bg={status.toLowerCase() + ".100"}
{...iconProps}
/>
</Box>
);
break;
case "Absent":
icon = (
<Box {..._box} color={color ? color : "absent.500"}>
<IconByName
name={type === "Send" ? "MailFillIcon" : "MailForbidFillIcon"}
p="5px"
rounded="full"
_icon={{ size: "14" }}
bg={status.toLowerCase() + ".100"}
{...iconProps}
/>
</Box>
);
break;
case "Holiday":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.100"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
case "Unmarked":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.500"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
case "Today":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.500"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
default:
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.400"}>
<IconByName name={status} {...iconProps} />
</Box>
);
break;
}
return icon;
};

let icon = <></>;
let iconProps = { fontSize: "xl", isDisabled: true, ..._icon };
switch (status) {
case "Present":
icon = (
<Box {..._box} color={color ? color : "present.500"}>
<IconByName
name={type === "Send" ? "MailFillIcon" : "MailForbidFillIcon"}
p="5px"
rounded="full"
_icon={{ size: "14" }}
bg={status.toLowerCase() + ".100"}
{...iconProps}
/>
</Box>
);
break;
case "Absent":
icon = (
<Box {..._box} color={color ? color : "absent.500"}>
<IconByName
name={type === "Send" ? "MailFillIcon" : "MailForbidFillIcon"}
p="5px"
rounded="full"
_icon={{ size: "14" }}
bg={status.toLowerCase() + ".100"}
{...iconProps}
/>
</Box>
);
break;
case "Holiday":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.100"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
case "Unmarked":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.500"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
case "Today":
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.500"}>
<IconByName name="CheckboxBlankCircleLineIcon" {...iconProps} />
</Box>
);
break;
default:
icon = (
<Box {..._box} color={color ? color : "attendanceUnmarked.400"}>
<IconByName name={status} {...iconProps} />
</Box>
);
break;
}
return icon;
};

export default GetIcon
export default GetIcon;
11 changes: 5 additions & 6 deletions packages/attendance/src/atoms/LinkHOC.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react'
import React from "react";
import { Link, useParams } from "react-router-dom";

const LinkHOC = ({children, ...rest}) => {

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

export default LinkHOC
export default LinkHOC;
68 changes: 28 additions & 40 deletions packages/attendance/src/atoms/Loader.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
import React from 'react'
import {
Center,
Heading,
HStack,
Spinner,
Text,
VStack,
} from "native-base";
import React from "react";
import { Center, Heading, HStack, Spinner, Text, VStack } from "native-base";


const Loader = ({success, fail}) => {
const Loader = ({ success, fail }) => {
return (
<Center flex={1} px="3">
<Center
_text={{
color: "white",
fontWeight: "bold",
}}
height={200}
width={{
base: 200,
lg: 400,
}}
>
<VStack space={2} alignItems={"center"}>
<Text>
{success ? success : ""}
</Text>
<Text>
{fail ? fail : ""}
</Text>
<HStack space={2} alignItems="center">
<Spinner accessibilityLabel="Loading posts" />
<Heading color="primary.500" fontSize="md">
Loading
</Heading>
</HStack>
</VStack>
<Center
_text={{
color: "white",
fontWeight: "bold",
}}
height={200}
width={{
base: 200,
lg: 400,
}}
>
<VStack space={2} alignItems={"center"}>
<Text>{success ? success : ""}</Text>
<Text>{fail ? fail : ""}</Text>
<HStack space={2} alignItems="center">
<Spinner accessibilityLabel="Loading posts" />
<Heading color="primary.500" fontSize="md">
Loading
</Heading>
</HStack>
</VStack>
</Center>
</Center>
</Center>
)
}
);
};

export default Loader
export default Loader;
Loading

0 comments on commit 21979c9

Please sign in to comment.