Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified the highlighted section #381

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@emotion/css": "^11.10.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.10.0",
"@iconify-icons/ep": "^1.2.12",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets try to stick to tabler/icons-react or decide on a single set of icons to use in general, i think we have too many in the project now 😆

"@iconify-icons/mdi": "^1.2.47",
"@mantine/core": "^7.10.0",
"@mantine/dates": "^7.10.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
setSundryIcons,
} from '@nathanstitt/sundry/ui'

import arrowDown from '@iconify-icons/ep/arrow-down'
import clockOutline from '@iconify-icons/mdi/clock-outline'
import plusCircleOutline from '@iconify-icons/mdi/plus-circle-outline'
import plus from '@iconify-icons/mdi/plus'
Expand Down Expand Up @@ -47,6 +48,7 @@ import instagram from '@iconify-icons/mdi/instagram'
import twitter from '@iconify-icons/mdi/twitter'

export const ICONS = {
arrowDown,
clockOutline,
plusCircleOutline,
plus,
Expand Down
46 changes: 37 additions & 9 deletions frontend/src/screens/learner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { React } from '@common'
import { ParticipantStudy } from '@api'
import { Footer, TopNavBar } from '@components'
import { Footer, TopNavBar, Icon } from '@components'
import { useEnvironment, useIsMobileDevice } from '@lib'
import { useParticipantStudies, useSearchStudies } from './learner/studies'
import { StudyCard } from './learner/card'
Expand All @@ -21,23 +21,51 @@ const HighlightedStudies: FC = () => {
const { highlightedStudies } = useParticipantStudies()
const isMobile = useIsMobileDevice()

const handleClick = () => {
Coder-Srinivas marked this conversation as resolved.
Show resolved Hide resolved
const element = document.getElementById('all-studies-unique-id')
element?.scrollIntoView({ behavior: 'smooth' })
}

if (!highlightedStudies.length) return null

return (
<Box bg={colors.navy} py='md'>
<Container>
<Stack>
<Title c='white' order={2}>Highlighted Studies</Title>
{isMobile ?
<MobileStudyCards studies={highlightedStudies} /> :
<DesktopStudyCards studies={highlightedStudies} />
}
</Stack>
<Flex direction='column'>
Coder-Srinivas marked this conversation as resolved.
Show resolved Hide resolved
<Flex justify='space-between'>
<CuratedStudies />
{isMobile ?
<MobileStudyCards studies={highlightedStudies} /> :
<DesktopStudyCards studies={highlightedStudies} />
}
</Flex>
<Flex c={colors.green} justify='center' align='center'>
<Flex direction='column' justify='center' align='center' style={{ cursor: 'pointer' }} onClick={()=> handleClick()}>
<Text size='sm'>View all studies</Text>
<Icon icon='arrowDown' width='.875rem'></Icon>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer to use tabler here

</Flex>
</Flex>
</Flex>
</Container>
</Box>
)
}

const CuratedStudies: FC = () => {

return (
<Flex c={colors.white} direction='column' w='280px' h='350px' pt='2.25rem' mt='1rem'>
Coder-Srinivas marked this conversation as resolved.
Show resolved Hide resolved
<Title order={2}>Curated Studies</Title>
<Title order={5}>by our learning scientists</Title>

<Stack mt='1rem'>
<Text pr='1.5rem'>Deepen your understanding of learning habits with scientific studies currated by our team of education researchers.</Text>
<Text>Accelerate your growth and tailor your path to your own needs.</Text>
</Stack>
</Flex>
)
}

const LearnerDashboard = () => {
const env = useEnvironment()

Expand Down Expand Up @@ -90,7 +118,7 @@ export const SearchBar: FC<{search: string, setSearch: (search: string) => void}

export const StudiesTitle: FC<{search: string, filteredStudies: ParticipantStudy[]}> = () => {
return (
<Title order={2}>All Studies</Title>
<Title order={2} id='all-studies-unique-id'>All Studies</Title>
)
}

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/screens/learner/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ interface StudyCardProps {
}

const Card = styled(Box)({
minWidth: 400,
maxWidth: 400,
minWidth: 264,
maxWidth: 264,
backgroundColor: 'white',
padding: '1rem',
boxShadow: '0px 6px 10px rgba(0, 0, 0, 0.1)',
position: 'relative',
color: 'inherit',
textDecoration: 'none',
cursor: 'pointer',
minHeight: 500,
maxHeight: 500,
minHeight: 350,
maxHeight: 350,
borderRadius: 8,
overflow: 'hidden',
'&:hover': {
Expand Down
7 changes: 7 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,13 @@
dependencies:
"@iconify/types" "*"

"@iconify-icons/ep@^1.2.12":
version "1.2.12"
resolved "https://registry.yarnpkg.com/@iconify-icons/ep/-/ep-1.2.12.tgz#c89a7e5e03416299cdddf047015f1d5bda7f040a"
integrity sha512-8EJULn048sQq3fvytpQ5j40omnVOdBKpo+sXdYM35NRrqCe1BihxBesMcCOLWaocqkWia6uTQ3cnRHff4ZA11w==
dependencies:
"@iconify/types" "*"

"@iconify-icons/mdi@^1.2.47":
version "1.2.47"
resolved "https://registry.npmjs.org/@iconify-icons/mdi/-/mdi-1.2.47.tgz"
Expand Down
Loading