Skip to content

Commit

Permalink
Side menu, language menu, faqPage
Browse files Browse the repository at this point in the history
  • Loading branch information
paritshivani committed Mar 15, 2024
1 parent f02ea2b commit 06091c5
Show file tree
Hide file tree
Showing 12 changed files with 366 additions and 128 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

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

# - name: Run the tests and generate coverage report
# run: yarn test
Expand Down
2 changes: 1 addition & 1 deletion module-template/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Shiksha</title>
<title>NULP</title>
</head>
<body style="background-color: rgb(248, 248, 249)">
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
5 changes: 3 additions & 2 deletions packages/common-lib/src/components/SearchLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ export default function SearchLayout({
placeholder={
searchPlaceholder
? searchPlaceholder
: `Type ${minStringLenght ? 'min ' + minStringLenght : ''}
to search `
:'Search Here'
// : `Type ${minStringLenght ? 'min ' + minStringLenght : ''}to search `

}
/>
</HStack>
Expand Down
11 changes: 9 additions & 2 deletions packages/nulp_elite/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Registration from "pages/Registration";
import UserPrefData from "pages/UserPrefData";
import { ChakraProvider } from "@chakra-ui/react";
import Profile from "pages/Profile";
import FAQPage from "pages/FAQPage"

function App() {
const [search, setSearch] = React.useState(true);
Expand Down Expand Up @@ -56,8 +57,9 @@ function App() {
{
moduleName: "nulp_elite",
path: "/user",
component: User,

component: User
},{
moduleName: "nulp_elite",
path: "/registration",
component: Registration,
},
Expand All @@ -66,6 +68,11 @@ function App() {
path: "/userPrefData",
component: UserPrefData,
},
{
moduleName: "nulp_elite",
path: "/help",
component: FAQPage,
}
];

// return(
Expand Down
102 changes: 85 additions & 17 deletions packages/nulp_elite/src/pages/Contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { contentService } from "@shiksha/common-lib";
import URLSConfig from "../configs/urlConfig.json";
import { Layout,IconByName,SearchLayout,FilterButton,overrideColorTheme } from "@shiksha/common-lib";
import { NativeBaseProvider,Box, Stack, VStack,Text, HStack, Button, extendTheme,
Actionsheet,ScrollView,Heading } from "native-base";
Actionsheet,ScrollView,Heading ,useDisclose, Menu ,Image} from "native-base";

import { Link , useParams} from "react-router-dom";

const Contents = () => {
Expand Down Expand Up @@ -83,24 +84,91 @@ const Contents = () => {
return (
<Layout
isDisabledAppBar={true}
_header={{
title: "User Name",
// isEnableSearchBtn: true,
subHeading: "Hello",
iconComponent: (
<Link
to="/Courses"
style={{ color: "rgb(63, 63, 70)", textDecoration: "none" }}
>
<IconByName size='20px' name='Notification2LineIcon' />
</Link>
),
}}
_header={
{
rightIcon: (
<HStack paddingBottom={"25px"}>
<IconByName name="CloseCircleFillIcon" />
</HStack>
),
customeComponent: (
<Box flex={1} minH={"40px"}>

<HStack>
<VStack position={"relative"}
padding="10px"
top={"10px"}>

<Menu w="160"
trigger={triggerProps => {
return <Button alignSelf="center" variant="solid" {...triggerProps}>
<IconByName size='20px' name='MenuFillIcon' />
</Button>;

}}>
<Menu.Item>Help</Menu.Item>
<Menu.Item>Logout</Menu.Item>
</Menu>

</VStack>
<VStack></VStack>
<VStack>
<Image source={require("../assets/nulp_logo.jpeg")} alt="" size="sm" />
</VStack>
</HStack>

{/* <Right> */}
<Box
position={"absolute"}
right={"20px"}
top={"10px"}>
<Menu w="160"
trigger={triggerProps => {
return <Button alignSelf="center" variant="solid" {...triggerProps}>
Language
</Button>;
// }}>

}}>
<Menu.Item>English</Menu.Item>
<Menu.Item> Hindi</Menu.Item>
</Menu>
</Box>
{/* </Right> */}


{/* <Avatar
size="48px"
borderRadius=""
source={require("../assets/nulp_logo.jpeg")}
/> */}

{/* <VStack>
<Avatar
size="37px"
borderRadius="md"
source={{
uri: "https://via.placeholder.com/50x50.png",
}}
/>
</VStack> */}

</Box>
),
// title: "User Name",
// // isEnableSearchBtn: true,
// subHeading: "Hello",
// iconComponent: (

// ),
}

}
subHeader={

<Link
to="/"
style={{ color: "rgb(63, 63, 70)", textDecoration: "none" }}
style={{ textDecoration: "none" }}
>
<HStack space="4" justifyContent="space-between">
<VStack>
Expand All @@ -118,7 +186,7 @@ const Contents = () => {
</HStack>
</Link>
}
_subHeader={{ bg: "rgb(248, 117, 88)" }}
_subHeader={{ size: "20px" }}
_footer={{
menues: [
{
Expand All @@ -132,7 +200,7 @@ const Contents = () => {
route: "/all",
},
{
title: "AccountCircleLineIcon",
title: "Connections",
icon: "TeamLineIcon",
route: "/home",
},
Expand Down
100 changes: 30 additions & 70 deletions packages/nulp_elite/src/pages/Courses.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Courses.js
import React from "react";
import { NativeBaseProvider,Box, Stack, VStack,Text, HStack, Button, Image,extendTheme,H4,H1,BodyLarge,Avatar,
Actionsheet,ScrollView,Heading,useDisclose, Menu, Pressable } from "native-base";
import { Layout,IconByName,SearchLayout,FilterButton,overrideColorTheme } from "@shiksha/common-lib";
import { Box, VStack,Text, HStack, Button, Image,
Heading,useDisclose, Menu } from "native-base";
import { Layout,IconByName,SearchLayout } from "@shiksha/common-lib";
import { Link , useParams} from "react-router-dom";
import { useNavigate } from "react-router-dom";

const Courses = () => {
const [search, setSearch] = React.useState(true);
Expand All @@ -17,13 +18,12 @@ const Courses = () => {
onOpen,
onClose
} = useDisclose();
const logout = () => {
alert("logout");
};
const navigate = useNavigate();

const openHelp = () => {
alert("openHelp")
};
const redirectTo = async (path) => {
// Perform logout logic here if path is logout
window.location.href = path;
}
return (
<Layout
isDisabledAppBar={true}
Expand All @@ -38,83 +38,43 @@ const Courses = () => {
<Box flex={1} minH={"40px"}>

<HStack>
<VStack>
<Menu w="190" trigger={triggerProps => {
return <Pressable accessibilityLabel="More options menu" {...triggerProps}>
<VStack position={"relative"}
padding="10px"
top={"10px"}>
<Menu w="160"
trigger={triggerProps => {
return <Button alignSelf="center" variant="solid" {...triggerProps}>
<IconByName size='20px' name='MenuFillIcon' />
Menu
</Pressable>;
</Button>;

}}>
<Menu.Item>Arial</Menu.Item>
<Menu.Item>Nunito Sans</Menu.Item>
<Menu.Item>Roboto</Menu.Item>
<Menu.Item>Poppins</Menu.Item>
<Menu.Item>SF Pro</Menu.Item>
<Menu.Item>Helvetica</Menu.Item>
<Menu.Item isDisabled>Sofia</Menu.Item>
<Menu.Item>Cookie</Menu.Item>
<Menu.Item onPress={(item) => redirectTo("/help")}>Help</Menu.Item>
<Menu.Item onPress={(item) => redirectTo("/logoff")}>Logout</Menu.Item>
</Menu>

</VStack>
<VStack></VStack>
<VStack>
<Image source={require("../assets/nulp_logo.jpeg")} alt="" size="sm" />
</VStack>
</HStack>

{/* <Right> */}

<Box
position={"absolute"}
right={"20px"}
top={"10px"}>
<Menu w="190" trigger={triggerProps => {
return <Pressable accessibilityLabel="More options menu" {...triggerProps}>
Language
</Pressable>;
<Menu w="160"
trigger={triggerProps => {
return <Button alignSelf="center" variant="solid" {...triggerProps}>
Language
</Button>;
}}>
<Menu.Item>English</Menu.Item>
<Menu.Item> Hindi</Menu.Item>
</Menu>
</Box>
{/* </Right> */}


{/* <Avatar
size="48px"
borderRadius=""
source={require("../assets/nulp_logo.jpeg")}
/> */}

{/* <VStack>
<Avatar
size="37px"
borderRadius="md"
source={{
uri: "https://via.placeholder.com/50x50.png",
}}
/>
</VStack> */}

</Box>
</Box>
),
// title: "User Name",
// // isEnableSearchBtn: true,
// subHeading: "Hello",
// iconComponent: (

// ),
}
// <Link
// to="/Courses"
// style={{ color: "rgb(63, 63, 70)", textDecoration: "none" }}
// >
// <HStack space="50" justifyContent="space-between">
// <VStack>
// <IconByName size='20px' name='MenuFillIcon' />

// </VStack>
// </HStack>
// </Link>

),
}
}
subHeader={

Expand Down Expand Up @@ -152,7 +112,7 @@ const Courses = () => {
route: "/all",
},
{
title: "AccountCircleLineIcon",
title: "Connections",
icon: "TeamLineIcon",
route: "/home",
},
Expand Down
Loading

0 comments on commit 06091c5

Please sign in to comment.