Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

71 add problem num page #86

Merged
merged 60 commits into from
Jan 12, 2024
Merged

71 add problem num page #86

merged 60 commits into from
Jan 12, 2024

Commits on Jan 12, 2024

  1. chore(components:error): add Error component

      ## what
      - add `Error` component
    
      ## how
      - takes in two props
        - status: http status code
        - message (optional): message to display under the status code
    
      ## why
      - this will be displayed in a page if there's an error returned when
        fetching the api server
      - using `nextjs` app router `error.tsx` doesn't help
        - ex: if there's an 404 error, the `error` page rendered, not
          `not-found.tsx`
        - ex: if there's an 400 errror, the `error` page is rendered but the
          error is unhandled
    
      ## where
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    c3822ec View commit details
    Browse the repository at this point in the history
  2. refactor: move schema validation for endpoint `/api/problems/[problem…

    …Num]` to it's own file
    
      ## what
      - move schema validation for endpoint `/api/problems/[problemNum]` to it's own file
      - add schema in `/api/problems/[problemNum]` via import
    
      ## how
    
      ## why
      - the schema validation will also be used in the client side
        - used in `/problems[problemNum]`
    
      ## where
      - ./src/app/api/problems/[problemNum]/route.ts
      - ./src/schema/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    1861c46 View commit details
    Browse the repository at this point in the history
  3. chore(hooks): add react-query hook to fetch stats of problem number

      ## what
      - add react-query hook to fetch stats of problem number
    
      ## how
      - fetch from api endpoint `/api/problems/[problemNum]`
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    5d0a953 View commit details
    Browse the repository at this point in the history
  4. chore(api:problemNum): return status 404 if problem number is not found

      ## what
      - return status 404 if problem number is not found
    
      ## how
    
      ## why
      - this will ensure a problem number not found will be handled
    
      ## where
      - ./src/app/api/problems/[problemNum]/route.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    9aa19d2 View commit details
    Browse the repository at this point in the history
  5. refactor(utils:constants): add type number to uhunt urls

      ## what
      - add type `number` to uhunt urls
    
      ## how
    
      ## why
      - it's a little tedious to convert number to a string when using the
        function
    
      ## where
      - ./src/utils/constants.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    8494065 View commit details
    Browse the repository at this point in the history
  6. feat(page:problemNum): fetch stats for /problems/[problemNum] page

      ## what
      - fetch stats for `/problems/[problemNum]` page
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    00f6b71 View commit details
    Browse the repository at this point in the history
  7. build(shadcn): add component Card

      ## what
      - add component `Card`
    
      ## how
      - run command
        npx shadcn-ui@latest add card
    
      ## why
    
      ## where
      - ./src/components/ui/card.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    ae5ee45 View commit details
    Browse the repository at this point in the history
  8. chore(page:problemNum): add structure and placeholder components

      ## what
      - add structure and placeholder components
    
      ## how
      - divide into to big sections
        - charts
          - uses grid for display
          - 2 columns on md to larger screens
          - 1 column on smaller screens
        - table
          - uses flex for display
          - will be in flex column direction
    
      ## why
      - this will show how the components are laid out
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    c2cde14 View commit details
    Browse the repository at this point in the history
  9. chore(types): add object ProblemVerdictMap

      ## what
      - add object `ProblemVerdictMap`
    
      ## how
    
      ## why
      - will be used to convert verdict keys in `Problem` type into a
        readable string
    
      ## where
      - ./src/types/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    4b817bf View commit details
    Browse the repository at this point in the history
  10. build(npm): add package recharts

      ## what
      - add package `recharts`
    
      ## how
    
      ## why
    
      ## where
      - ./package-lock.json
      - ./package.json
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    342b67f View commit details
    Browse the repository at this point in the history
  11. chore(tailwind): add tremor tailwindcss config

      ## what
      - add `tremor` tailwindcss config
        - brand colors
          - light mode
          - dark mode
        - background colors
          - light mode
          - dark mode
        - border colors
          - light mode
          - dark mode
        - content colors
          - light mode
          - dark mode
        - box shadow
          - light
          - dark
        - border radius
        - font size
    
      ## how
      - obtained from
        - https://www.tremor.so/docs/getting-started/installation
    
      ## why
      - some of the tailwindcss styles from `tremor.so` will be used in this app
        - using chart styles
          - bar chart
          - line chart
          - area chart
          - tooltip styles
    
      ## where
      - ./tailwind.config.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    94add56 View commit details
    Browse the repository at this point in the history
  12. chore(utils:processing): add function to generate data for rechart

    …bar chart
    
      ## what
      - add function to generate data for `rechart` bar chart
    
      ## how
    
      ## why
      - this will be used to generate the data needed for `recharts` bar
        chart to render
    
      ## where
      - ./src/utils/dataProcessing.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    3c73fac View commit details
    Browse the repository at this point in the history
  13. refactor(types): combine multiple instances of Verdict into one

      ## what
      - combine multiple instances of `Verdict` into one
        - add type `ProblemVerdictType`
          - title: string to display in client side. usually for displaying tooltip title
          - bgColor: tailwindcss background color
          - fgColor: tailwindcss foreground color
          - bgHex: hexcode of property `bgColor`
          - fgHex: hexcode of propetty `fgColor`
        - apply type `ProblemVerdictType` in object `ProblemVerdictMap`
          - set their properties
          - set `Problem.ver` number as key into object `ProblemVerdictMap`
            - they map to the same key in the object `ProblemVerdictMap
            - doing this way to prevent duplocate code`
        - remove `VerdictType`
        - remove `Verdict`
          - the keys of this object are applied in object `ProblemVerdictMap`
        - set property `Submission.verdict` to type `ProblemVerdictType`
      - apply changes to other files
        - replace `Verdict` with `ProblemVerdictMap` in api endpoint
          `/api/poll[pollId]`
    
      ## how
    
      ## why
      - this to remove duplicate code
      - to combine string abbreviation of the verdict into object `ProblemVerdictMap`
      - to combine verdict ID from `Submission` into object `ProblemVerdictMap`
      - refactoring these later would be difficult
    
      ## where
      - ./src/app/api/poll/[pollId]/route.ts
      - ./src/types/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    2c90582 View commit details
    Browse the repository at this point in the history
  14. chore(utils:processing): use array to filter out keys from `ProblemVe…

    …rdictMap`
    
      ## what
      - use array to filter out keys from `ProblemVerdictMap`
        - use an array to filter which keys to keep in `ProblemVerdictMap`
        - filter out keys from ProblemVerdictMap using the array
        - update references
          - setting `tooltipTitle`
          - setting `fill`
    
      ## how
    
      ## why
      - to keep up with the changes in `ProblemVerdictMap`
        - check c041074
      - be default `ProblemVerdictMap` contains all verdicts
        - don't need to show all of them in a bar chart
    
      ## where
      - ./src/utils/dataProcessing.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    9fe0374 View commit details
    Browse the repository at this point in the history
  15. docs(types): add file header docs

      ## what
      - add file header docs
    
      ## how
    
      ## why
      - to explain what is this file used for
    
      ## where
      - ./src/types/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    7ebf522 View commit details
    Browse the repository at this point in the history
  16. feat(components:charts): add Recharts custom tooltip component

      ## what
      - add Recharts custom tooltip component
    
      ## how
      - obtained from
        - https://github.com/tremorlabs/tremor/blob/main/src/components/chart-elements/common/ChartTooltip.tsx
      - note
        - this tooltip is from `tremor.so` , and it uses tailwindcss custom
          configs, which means `tailwind.config.ts` needs to be updated
          - done in commit 1e5b14f
    
      ## why
      - this will be used in charts
      - this is will make chart tooltips more pleasing to look at compared
        to the default tooltips
    
      ## where
      - ./src/components/charts/Tooltip.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f0d1e9d View commit details
    Browse the repository at this point in the history
  17. feat(components:charts): add ProblemVerdictChart component

      ## what
      - add `ProblemVerdictChart` component
    
      ## how
      - uses Rechart bar chart
      - uses custom tooltip component in `./src/components/charts/Tooltip`
    
      ## why
      - this will be used to display a problem number submission verdicts
        using a bar chart
    
      ## where
      - ./src/components/charts/ProblemVerdictChart.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    95c6bfa View commit details
    Browse the repository at this point in the history
  18. feat(page:problemNum): render ProblemVerdictChart component

      ## what
      - render `ProblemVerdictChart` component
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    ffff3a8 View commit details
    Browse the repository at this point in the history
  19. chore(schema:submission): add schema for endpoint `/api/submissions/o…

    …vertime/[problemNum]`
    
      ## what
      - add schema for endpoint `/api/submissions/overtime/[problemNum]`
    
      ## how
    
      ## why
      - this will be used to validate the data on client side and server
        side
    
      ## where
      - ./src/schema/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    72b4efe View commit details
    Browse the repository at this point in the history
  20. feat(api:submission): add endpoint `/api/submissions/overtime/[proble…

    …mNum]`
    
      ## what
      - add endpoint `/api/submissions/overtime/[problemNum]`
        - get the submission count of a problem using problem number
          - if invalid `problem number` is given, a response of 400 will be returned
          - if the problem doesn't exist, a response of 404 will be returned
          - the endpoint will return a cumulative submission count
            - an array of object
              - time: momentjs time serialized
              - count: submission count from current index + the previous
                index
    
      ## how
    
      ## why
      - this will be used to chart submissions overtime of a problem
    
      ## where
      - ./src/app/api/submissions/overtime/[problemNum]/route.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    87d9f51 View commit details
    Browse the repository at this point in the history
  21. chore(hooks): add react-query hook to fetch submissions overtime

      ## what
      - add react-query hook to fetch submissions overtime
    
      ## how
      - fetch from api endpoint `/api/submissions/overtime/[problemNum]`
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    44ea845 View commit details
    Browse the repository at this point in the history
  22. feat(components:charts): add SubmissionsOvertimeChart component

      ## what
      - add `SubmissionsOvertimeChart` component
    
      ## how
      - takes prop
        - data of type `SubmisionsOvertimeType[]`
      - use Recharts `AreaChart` component
      - use custom tooltip from `./src/components/charts/Tooltip`
      - use linear gradient for color the area chart
    
      ## why
      - this will be used to display submissions overtime of a problem using
        area chart
    
      ## where
      - ./src/components/charts/SubmissionsOvertimeChart.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    fbe6a8c View commit details
    Browse the repository at this point in the history
  23. feat(page:problemNum): render SubmissionOvertimeChart component

      ## what
      - render `SubmissionOvertimeChart` component
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    d3a62d9 View commit details
    Browse the repository at this point in the history
  24. chore(types): add Python as a value in Language object

      ## what
      - add `Python` as a value in `Language` object
    
      ## how
    
      ## why
      - found a case where the language id was not present in the `Language`
        object.
        - after a little investigation, I found that this new id is for the
          language `Python`
    
      ## where
      - ./src/types/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    c624a78 View commit details
    Browse the repository at this point in the history
  25. chore(schema:submission): add schema for endpoint `/api/submissions/l…

    …anguage/[problemNum]`
    
      ## what
      - add schema for endpoint `/api/submissions/language/[problemNum]`
    
      ## how
    
      ## why
      - this will be used to validate the data on client side and server
        side
    
      ## where
      - ./src/schema/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    fdd935e View commit details
    Browse the repository at this point in the history
  26. refactor(utils:constants): limit start range when fetching submission…

    …s of a problem
    
      ## what
      - limit start range when fetching submissions of a problem
        - limit submissions from today to 1 year ago and return 500
          submissions
      - add params
        - startSubmission: starting point when searching for submissions
          - default to 1 year before in unix time. in other words, it will
            return submissions starting from 1 year ago
        - endSubmission: ending point when searching for submissions
          - default to current time.
        - limit: limit number of submissions to value provided
          - default to 500. in other words it will always return 500
            submissions of a problem
          - currently not being used.
          - how to use
            - append the number to end
              - ex: https://uhunt.onlinejudge.org/api/p/subs/36/0/1707350533/500
                - the 500 in the end of url will limit number of
                  submissions to 500
    
      ## how
    
      ## why
      - before the start range was set to 0, which would fetch every
        submission for the problem
        - this would fetch too many items and it would take a while to
          process them
    
      ## where
      - ./src/utils/constants.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    d3c208c View commit details
    Browse the repository at this point in the history
  27. feat(api:submission:language): add endpoint `/api/submissions/languag…

    …e/[problemNum]`
    
      ## what
      - add endpoint `/api/submissions/language/[problemNum]`
        - get submissions language count of a problem using problem number
          - if invalid `problem number` is given, a response of 400 will be returned
          - if the problem doesn't exist, a response of 404 will be returned
          - fetch submissions of problem number
          - count submission language
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/api/submissions/language/[problemNum]/route.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f853c3c View commit details
    Browse the repository at this point in the history
  28. chore(hooks): add react-query hook to fetch submission language

      ## what
      - add react-query hook to fetch submission language
    
      ## how
      - fetch from api endpoint `/api/submissions/language/[problemNum]`
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    b13d723 View commit details
    Browse the repository at this point in the history
  29. chore(utils:processing): add function to generate data for recharts

    … radar chart
    
      ## what
      - add function to generate data for `recharts` radar chart
    
      ## how
      - loop through the object
        - add object to array
          - property `language`: string version of the language ID
          - property `count`: number of submissions of that language ID
    
      ## why
      - this will be used to generate the data needed for `recharts` radar
        chart to render
    
      ## where
      - ./src/utils/dataProcessing.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f9d73bb View commit details
    Browse the repository at this point in the history
  30. feat(components:charts): add SubmissionLanguageRadarChart component

      ## what
      - add `SubmissionLanguageRadarChart` component
    
      ## how
      - takes a prop
        - data of type `/api/submissions/language/[problemNum]` GET response
      - process the data
      - use Recharts `radar` chart
      - use custom tooltip from `./src/components/charts/Tooltip`
      - use radial gradient for color inside of the radar
    
      ## why
      - this will display submissions by language of a problem using `radar`
        chart
    
      ## where
      - ./src/components/charts/SubmissionLanguageRadarChart.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f88b60b View commit details
    Browse the repository at this point in the history
  31. feat(page:problemNum): render SubmissionLanguageRadarChart component

      ## what
      - render `SubmissionLanguageRadarChart` component
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    4a32e1c View commit details
    Browse the repository at this point in the history
  32. chore(schema:problemNum:ranklist): add schema for endpoint `/api/prob…

    …lems/ranklist/[problemNum]`
    
      ## what
      - add schema for endpoint `/api/problems/ranklist/[problemNum]`
    
      ## how
    
      ## why
      - this will be used to validate the data on client side and server
        side
    
      ## where
      - ./src/schema/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    71288d9 View commit details
    Browse the repository at this point in the history
  33. feat(api:problemNum:ranklist): add endpoint `/api/problems/ranklist/[…

    …problemNum]`
    
      ## what
      - add endpoint `/api/problems/ranklist/[problemNum]`
        - get ranklist of a problem using problem number
          - if invalid `problem number` is given, a response of 400 will be returned
          - if the problem doesn't exist, a response of 404 will be returned
          - fetch problem ranklist
          - add extra properties
            - verdict object
              - fgColor
              - bgColor
              - title
              - fgHex
              - bgHex
            - language: convert language ID into a string
            - pnum: problem number
            - pTitle: name of the problem
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/api/problems/ranklist/[problemNum]/route.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    73703f4 View commit details
    Browse the repository at this point in the history
  34. chore(hooks): add react-query hook to fetch problem ranklist

      ## what
      - add react-query hook to fetch problem ranklist
    
      ## how
      - fetch from endpoint `/api/problems/ranklist/[problemNum]`
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    bd6d759 View commit details
    Browse the repository at this point in the history
  35. chore(shadcn:data-table): add columns structure for problem ranklist …

    …table
    
      ## what
      - add columns structure for problem ranklist table
        - define which columns to display on the DataTable
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/components/data-table/ranklistColumns.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    5c1482a View commit details
    Browse the repository at this point in the history
  36. build(npm): add package @tanstack/react-virtual

      ## what
      - add package `@tanstack/react-virtual`
    
      ## how
    
      ## why
    
      ## where
      - ./package-lock.json
      - ./package.json
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f0caca6 View commit details
    Browse the repository at this point in the history
  37. feat(components): add VirtualTable component

      ## what
      - add `VirtualTable` component
    
      ## how
      - uses
        - `@tanstack/react-table` to generate a table
        - `@tanstack/react-virtual` to handle virtualization
    
      ## why
      - to display a table without the `DataTable` functionality
    
      ## where
      - ./src/components/virtual-table/index.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    1f88244 View commit details
    Browse the repository at this point in the history
  38. feat(page:problemNum): render VirtualTable for ranklist

      ## what
      - render `VirtualTable` for ranklist
        - fetch problem ranklist using react-query hook
        - render data using VirtualTable
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    2f9c6f9 View commit details
    Browse the repository at this point in the history
  39. chore(schema:problemNum:submission): add schema for endpoint `/api/su…

    …bmissions/[problemNum]`
    
      ## what
      - add schema for endpoint `/api/submissions/[problemNum]`
    
      ## how
    
      ## why
      - this will be used to validate the data on client side and server
        side
    
      ## where
      - ./src/schema/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    3a5c336 View commit details
    Browse the repository at this point in the history
  40. feat(api:problemNum:submission): add endpoint `/api/submissions/[prob…

    …lemNum]`
    
      ## what
      - add endpoint `/api/submissions/[problemNum]`
        - get submissions of a problem using problem number
          - if invalid `problem number` is given, a response of 400 will be returned
          - if the problem doesn't exist, a response of 404 will be returned
          - fetch problem submissions
          - add extra properties
            - verdict
              - fgColor
              - bgColor
              - title
              - fgHex
              - bgHex
            - language: convert language ID into a string
            - pnum: problem number
            - pTitle: name of the problem
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/api/submissions/[problemNum]/route.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a33642c View commit details
    Browse the repository at this point in the history
  41. chore(hooks): add react-query hook to fetch problem submissions

      ## what
      - add react-query hook to fetch problem submissions
    
      ## how
      - fetch from endpoint `/api/submissions/[problemNum]`
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    ea04c0f View commit details
    Browse the repository at this point in the history
  42. feat(page:problemNum): render VirtualTable for Problem submissions

      ## what
      - render `VirtualTable` for `Problem submissions`
        - fetch problem submissions using react-query hook
        - render data using VirtualTable
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    2f41cb8 View commit details
    Browse the repository at this point in the history
  43. chore(utils:constants): use the limit value when fetching problem sub…

    …missions
    
      ## what
      - use the limit value when fetching problem submissions
    
      ## how
      - uses the parameter `limit` value
        - default is 500
    
      ## why
      - this will limit the number of submissions returned
    
      ## where
      - ./src/utils/constants.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    8f19b98 View commit details
    Browse the repository at this point in the history
  44. chore(components:charts): change radar chart grid opacity depending o…

    …n theme
    
      ## what
      - change rader chart grid opacity depending on theme
        - set radar chart grid opacity to 0.3 in dark mode
        - set radar chart grid opacity to 1.0 in light mode
    
      ## how
    
      ## why
      - the opacity of 0.3 is barely visible in light mode
      - cant change the fill color of the radar chart grid
    
      ## where
      - ./src/components/charts/SubmissionLanguageRadarChart.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    1c40b5d View commit details
    Browse the repository at this point in the history
  45. chore(page:problemNum): render problem number and title

      ## what
      - render problem number and title
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    4f1eeeb View commit details
    Browse the repository at this point in the history
  46. feat(shadcn:data-table): set DataTable height if provided

      ## what
      - set DataTable height if provided
    
      ## how
      - take `height` as a prop
      - set the height of the table if it's defined
      - set the table to overflow-y if height is defined
    
      ## why
      - a replacement for `VirtualTable`
        - VirtualTable struggles to scroll when theres high amounts of items
          to render. DataTable can handle high items without issue
      - to have the ability to set the size of the DataTable
    
      ## where
      - ./src/components/ui/data-table/index.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    1fd42fa View commit details
    Browse the repository at this point in the history
  47. refactor(page:problemNum): use DataTable to render ranklist and sub…

    …missions
    
      ## what
      - use `DataTable` to render ranklist and submissions
        - set a max height to the DataTable
    
      ## how
    
      ## why
      - DataTable can handle high volumes of items when scrolling
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    6a6a205 View commit details
    Browse the repository at this point in the history
  48. refactor(api:problemNum:submission): set submission limit to 500

      ## what
      - set submission limit to 500
    
      ## how
    
      ## why
      - Since the DataTable is being used to display problem submissions, it
        can handle a high amount of items to be rendered
    
      ## where
      - ./src/app/api/submissions/[problemNum]/route.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    fc9a834 View commit details
    Browse the repository at this point in the history
  49. chore(page:problemNum): add Loading component for `/problems/[probl…

    …emNum]` page
    
      ## what
      - add `Loading` component for `/problems/[problemNum]` page
    
      ## how
    
      ## why
      - this will be used to display when fetching data on the
        `/problems/[problemNum]` page
    
      ## where
      - ./src/app/problems/[problemNum]/loading.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    1865362 View commit details
    Browse the repository at this point in the history
  50. chore(page:problemNum): use Loading component

      ## what
      - use `Loading` component
        - use component from `./src/app/problems/[problemNum]/loading.tsx`
    
      ## how
    
      ## why
      - this will be used to display when fetching data for
        `problems/[problemNum]` page
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    2df5b87 View commit details
    Browse the repository at this point in the history
  51. feat(page:problemNum): set title as link to view problem pdf

      ## what
      - set title as link to view problem pdf
    
      ## how
    
      ## why
      - to be able to view the problem that is currently loaded
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    6d8b8c1 View commit details
    Browse the repository at this point in the history
  52. style(page:problemNum): format code

      ## what
      - format code
    
      ## how
    
      ## why
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    7a09975 View commit details
    Browse the repository at this point in the history
  53. docs(docs:images): update images for /problems/[problemNum] page

      ## what
      - update images for `/problems/[problemNum]` page
        - loading
        - data loaded
    
      ## how
    
      ## why
    
      ## where
      - ./docs/images/page-problems-num-loading.png
      - ./docs/images/page-problems-num.png
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    49176ee View commit details
    Browse the repository at this point in the history
  54. docs(readme): display screenshots for /problems/[problemNum] page

      ## what
      - display screenshots for `/problems/[problemNum]` page
    
      ## how
    
      ## why
    
      ## where
      - ./README.md
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    d78c344 View commit details
    Browse the repository at this point in the history
  55. refactor(hooks:problemNum): extract data after fetching

      ## what
      - extract data after fetching when fetching from `/api/problems/[problemNum]`
    
      ## how
    
      ## why
      - this will prevent error `variable may be undefined` when using the
        hooks data
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    6fda608 View commit details
    Browse the repository at this point in the history
  56. refactor(page:problemNum): update reference when fetching problemNum …

    …stats
    
      ## what
      - update reference when fetching problemNum stats
    
      ## how
    
      ## why
      - to accommodate changes made in `./src/hooks/index.ts`
        - check 46ca37e
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    99ff8ef View commit details
    Browse the repository at this point in the history
  57. style(hooks): format code

      ## what
      - format code
    
      ## how
    
      ## why
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    6c2db23 View commit details
    Browse the repository at this point in the history
  58. build(npm): add script lint:tsc and lint:eslint

      ## what
      - add npm script
        - `lint:tsc`
        - `lint:eslint`
      - update npm script
        - `lint`
    
      ## how
    
      ## why
      - to lint code using typescript and eslint separately and together
    
      ## where
      - ./package.json
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    520d15a View commit details
    Browse the repository at this point in the history
  59. refactor(hooks): apply types returned when fetching

      ## what
      - apply types returned when fetching
    
      ## how
    
      ## why
      - to provide a data type when data is fetched
    
      ## where
      - ./src/hooks/index.ts
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    b1bd3d6 View commit details
    Browse the repository at this point in the history
  60. chore: apply types to the fetched data using react-query hooks

      ## what
      - apply types to the fetched data using react-query hooks
    
      ## how
    
      ## why
      - to deal with typescript errors
      - to accomodate changes made from d957416
    
      ## where
      - ./src/app/problems/[problemNum]/page.tsx
      - ./src/app/problems/page.tsx
    
      ## usage
    Clumsy-Coder committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    e91a596 View commit details
    Browse the repository at this point in the history