Skip to content

Commit

Permalink
#344 - change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Aug 30, 2023
1 parent 8f45b66 commit 1b6d161
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/NewsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { Typography, makeStyles } from "@material-ui/core";
import { useMemo } from "react";
import { Theme } from "@near-wallet-selector/modal-ui";

const useStyles = makeStyles<Theme, { changeWindowPassDue: boolean }>(() => ({
interface StyleProps {
exchangeWindowExpired: boolean;
}

const useStyles = makeStyles<Theme, StyleProps>(() => ({
bar: {
display: "flex",
alignItems: "center",
Expand All @@ -14,8 +18,8 @@ const useStyles = makeStyles<Theme, { changeWindowPassDue: boolean }>(() => ({
fontWeight: 500,
fontSize: "16px",
letterSpacing: "0.02em",
background: ({ changeWindowPassDue }) =>
changeWindowPassDue
background: ({ exchangeWindowExpired }) =>
exchangeWindowExpired
? "linear-gradient(1deg, #9577F4 0%, #AD55DA 28.96%, #CA2EBD 100%);"
: "linear-gradient(20deg, #f44b1b 0%, #eeb430 100%);",
},
Expand All @@ -25,7 +29,7 @@ const useStyles = makeStyles<Theme, { changeWindowPassDue: boolean }>(() => ({
borderRadius: 20,
padding: "6px 12px",
backgroundColor: "white",
color: ({ changeWindowPassDue }) => (changeWindowPassDue ? "#17153F" : "#F47B48"),
color: ({ exchangeWindowExpired }) => (exchangeWindowExpired ? "#17153F" : "#F47B48"),
marginLeft: "8px",
fontSize: "12px",
letterSpacing: "0.08em",
Expand Down Expand Up @@ -102,11 +106,11 @@ const messages = {
};

export default function NewsBar() {
const changeWindowPassDue = useMemo(() => new Date() < new Date(2023, 8, 4), []);
const classes = useStyles({ changeWindowPassDue });
const exchangeWindowExpired = useMemo(() => new Date() < new Date(2023, 8, 4), []);
const classes = useStyles({ exchangeWindowExpired });
const { content, href } = useMemo(
() => (changeWindowPassDue ? messages.cosmos : messages.cctp),
[changeWindowPassDue]
() => (exchangeWindowExpired ? messages.cosmos : messages.cctp),
[exchangeWindowExpired]
);
return (
<div className={classes.bar}>
Expand Down

0 comments on commit 1b6d161

Please sign in to comment.