Skip to content

Commit

Permalink
Add custom icons for time-based sorts (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilden authored Jul 26, 2023
1 parent 9955cf7 commit 527f0d9
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/features/feed/PostSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ import {
flameOutline,
helpCircleOutline,
timeOutline,
trophyOutline,
} from "ionicons/icons";

import calendarWeekIconSvg from "./icons/calendarWeek.svg";
import calendarSingleDaySvg from "./icons/calendarSingleDay.svg";
import clockBadgeOneSvg from "./icons/clockBadgeOne.svg";
import clockBadgeSixSvg from "./icons/clockBadgeSix.svg";
import clockBadgeTwelveSvg from "./icons/clockBadgeTwelve.svg";
import calendarYearSvg from "./icons/calendarYear.svg";

import { useAppDispatch, useAppSelector } from "../../store";
import { updateSortType } from "../post/postSlice";
import { useContext, useState } from "react";
Expand Down Expand Up @@ -140,14 +149,21 @@ function getSortIcon(sort: ExtendedSortType): string {
case "NewComments":
return chatbubbleEllipsesOutline;
case "TopHour":
return clockBadgeOneSvg;
case "TopSixHour":
return clockBadgeSixSvg;
case "TopTwelveHour":
return clockBadgeTwelveSvg;
case "TopDay":
return calendarSingleDaySvg;
case "TopMonth":
return calendarOutline;
case "TopWeek":
return calendarWeekIconSvg;
case "TopYear":
return calendarYearSvg;
case "TopAll":
return calendarOutline;
return trophyOutline;
case "Top":
return barChartOutline;
case "Old":
Expand Down
4 changes: 4 additions & 0 deletions src/features/feed/icons/calendarSingleDay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/features/feed/icons/calendarWeek.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/features/feed/icons/calendarYear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/features/feed/icons/clockBadgeOne.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/features/feed/icons/clockBadgeSix.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/features/feed/icons/clockBadgeTwelve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 527f0d9

Please sign in to comment.