-
Notifications
You must be signed in to change notification settings - Fork 0
Improvement/dashboard 2 #135
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1a0cca9
fix: allow customizable title size in TitleSection component
jpcmf 0b46e78
feat: add "Painel do criador" link to SidebarNav with new icon
jpcmf d24f14a
fix: add date-fns dependency
jpcmf 081c96f
feat: add formatSmartDate function for intelligent date formatting
jpcmf c1593fc
feat: add createdAt and updatedAt fields to UserBasics type
jpcmf 86e9dac
feat: define User type with associated fields and nested types
jpcmf bbb8501
feat: enhance Dashboard component with user status and profile links
jpcmf e1ca644
feat: update DashboardPage with localized title and clean up commente…
jpcmf 2ef9d92
feat: removing unnecessary line breaks
jpcmf 16abe0d
feat: refactor AuthContext to import User type and clean up user data…
jpcmf 6a02b18
feat: refactor LogoSkateHub component to simplify props and clean up …
jpcmf 78ddd2e
feat: update SidebarNav icons for improved clarity and consistency
jpcmf d9b8b07
feat: update Dashboard component to replace icon and remove unused te…
jpcmf b560514
feat: update SidebarNav component to adjust spacing for improved layout
jpcmf 1c7dc5b
feat: update Dashboard component to replace text with icon for irregu…
jpcmf 771e852
feat: update status display
jpcmf 1095115
feat: update getServerSideProps type definition for better type safety
jpcmf 6eae447
fix: standardize import quotes
jpcmf 14584d1
feat: update user last updated text to handle unavailable date
jpcmf f5a2d08
fix: update icon color to always display green for upload status
jpcmf d128884
fix: adjust date comparison logic in formatSmartDate function
jpcmf 37a3ebc
feat: enhance loading state in DashboardPage with Spinner component
jpcmf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,167 @@ | ||
| import { Box, SimpleGrid, Text } from "@chakra-ui/react"; | ||
| import { | ||
| RiAccountBoxLine, | ||
| RiBookOpenLine, | ||
| RiCircleFill, | ||
| RiMapPin2Line, | ||
| RiThumbDownLine, | ||
| RiThumbUpLine, | ||
| RiUploadFill, | ||
| RiVideoAddLine | ||
| } from "react-icons/ri"; | ||
| import Link from "next/link"; | ||
|
|
||
| import { Box, Heading, HStack, Icon, SimpleGrid, Text, useColorModeValue, VStack } from "@chakra-ui/react"; | ||
|
|
||
| import { TitleSection } from "@/components/TitleSection"; | ||
| import type { User } from "@/types/User.type"; | ||
| import { formatSmartDate } from "@/utils/date"; | ||
|
|
||
| type DashboardProps = { | ||
| user: any; | ||
| user: User; | ||
| }; | ||
|
|
||
| export function Dashboard({ user }: DashboardProps) { | ||
| const borderColor = useColorModeValue("green.200", "green.800"); | ||
| const bgColor = useColorModeValue("blackAlpha.100", "gray.800"); | ||
| const buttonBgColor = useColorModeValue("green.200", "green.800"); | ||
| const hoverBgColor = useColorModeValue("green.200", "green.400"); | ||
| return ( | ||
| <SimpleGrid m={0} columns={{ base: 1, md: 3 }} spacing={{ base: 5, lg: 4 }} w=""> | ||
| <Box p={["6", "8"]} bg="gray.800" borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Status do cadastro do atleta | ||
| </Text> | ||
| <Text color="green.400">{user?.name}</Text> | ||
| <Text color="green.400">Regular</Text> | ||
| </Box> | ||
|
|
||
| <Box p={["6", "8"]} bg="gray.800" borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Dados de acesso da semana | ||
| </Text> | ||
| {user?.name} <br /> | ||
| {user?.about} <br /> | ||
| </Box> | ||
|
|
||
| <Box p={["6", "8"]} bg="gray.800" borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Documentações | ||
| </Text> | ||
| <Text color="green.400" as="a" href="#" textDecoration={"underline"}> | ||
| Instruções para inscrição em eventos | ||
| </Text> | ||
| </Box> | ||
|
|
||
| <Box p={["6", "8"]} bg="gray.800" borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Taxa de abertura | ||
| </Text> | ||
| </Box> | ||
| </SimpleGrid> | ||
| <> | ||
| <SimpleGrid mb={6} columns={{ base: 1, md: 4 }} spacing={{ base: 5, lg: 4 }}> | ||
| <Box | ||
| as={Link} | ||
| href="/" | ||
| p={["6", "8"]} | ||
| bg={buttonBgColor} | ||
| borderWidth={2} | ||
| borderColor={borderColor} | ||
| borderRadius={8} | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| display="flex" | ||
| flexDirection="column" | ||
| _hover={{ textDecoration: "none", bg: hoverBgColor }} | ||
| > | ||
| <Icon as={RiVideoAddLine} boxSize={8} mb={4} /> | ||
| <Heading size="md" mb={4}> | ||
| Criar um story | ||
| </Heading> | ||
| </Box> | ||
| <Box | ||
| as={Link} | ||
| href="/" | ||
| p={["6", "8"]} | ||
| bg={buttonBgColor} | ||
| borderWidth={2} | ||
| borderColor={borderColor} | ||
| borderRadius={8} | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| textAlign="center" | ||
| display="flex" | ||
| flexDirection="column" | ||
| _hover={{ textDecoration: "none", bg: hoverBgColor }} | ||
| > | ||
| <Icon as={RiMapPin2Line} boxSize={8} mb={4} /> | ||
| <Heading size="md" mb={4}> | ||
| Criar um spot | ||
| </Heading> | ||
| </Box> | ||
| <Box | ||
| as={Link} | ||
| href="/" | ||
| p={["6", "8"]} | ||
| bg={buttonBgColor} | ||
| borderWidth={2} | ||
| borderColor={borderColor} | ||
| borderRadius={8} | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| textAlign="center" | ||
| display="flex" | ||
| flexDirection="column" | ||
| _hover={{ textDecoration: "none", bg: hoverBgColor }} | ||
| > | ||
| <Icon as={RiBookOpenLine} boxSize={8} mb={4} /> | ||
| <Heading size="md" mb={4}> | ||
| Criar um story | ||
| </Heading> | ||
| </Box> | ||
| <Box | ||
| as={Link} | ||
| href="/user/edit" | ||
| p={["6", "8"]} | ||
| bg={buttonBgColor} | ||
| borderWidth={2} | ||
| borderColor={borderColor} | ||
| borderRadius={8} | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| textAlign="center" | ||
| display="flex" | ||
| flexDirection="column" | ||
| _hover={{ textDecoration: "none", bg: hoverBgColor }} | ||
| > | ||
| <Icon as={RiAccountBoxLine} boxSize={8} mb={4} /> | ||
| <Heading size="md" mb={4}> | ||
| Editar meu perfil | ||
| </Heading> | ||
| </Box> | ||
| </SimpleGrid> | ||
|
|
||
| <TitleSection title="Visão geral" size="md" /> | ||
|
|
||
| <SimpleGrid m={0} columns={{ base: 1, md: 3 }} spacing={{ base: 5, lg: 4 }}> | ||
| <Box p={["6", "8"]} bg={bgColor} borderRadius={8} flex="50%"> | ||
| <VStack align="flex-start" spacing={4}> | ||
| <Text fontSize="lg" fontWeight="bold" mb="1"> | ||
| Status do cadastro do atleta | ||
| </Text> | ||
| <HStack> | ||
| {user.confirmed ? ( | ||
| <> | ||
| <Icon as={RiThumbUpLine} boxSize={5} color="green.400" /> | ||
| <Text fontSize="md">Regular</Text> | ||
| </> | ||
| ) : ( | ||
| <> | ||
| <Icon as={RiThumbDownLine} boxSize={5} color="red.400" /> | ||
| <Text fontSize="md">Irregular</Text> | ||
| </> | ||
| )} | ||
| </HStack> | ||
| <Text fontSize="lg" fontWeight="bold" mb="1"> | ||
| Status da conta | ||
| </Text> | ||
| <HStack> | ||
| <Icon as={RiCircleFill} boxSize={5} color={user.blocked ? "red.400" : "green.400"} /> | ||
| <Text fontSize="md">{user.blocked ? "Bloqueada" : "Ativa"}</Text> | ||
| </HStack> | ||
| <Text fontSize="lg" fontWeight="bold" mb="1"> | ||
| Dados de acesso da semana | ||
| </Text> | ||
| <HStack> | ||
| <Icon as={RiUploadFill} boxSize={5} color="green.400" /> | ||
| <Text fontSize="md">Última atualização: {formatSmartDate(user?.updatedAt || "Indisponível")}</Text> | ||
| </HStack> | ||
| </VStack> | ||
| </Box> | ||
|
|
||
| <Box p={["6", "8"]} bg={bgColor} borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Documentações | ||
| </Text> | ||
| <Text color="green.400" as="a" href="#" textDecoration={"underline"}> | ||
| Instruções para inscrição em eventos | ||
| </Text> | ||
| </Box> | ||
|
|
||
| <Box p={["6", "8"]} bg={bgColor} borderRadius={8} flex="50%"> | ||
| <Text fontSize="lg" fontWeight="bold" mb="4"> | ||
| Taxa de abertura | ||
| </Text> | ||
| </Box> | ||
| </SimpleGrid> | ||
| </> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.