Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 9 additions & 7 deletions shared-ui/components/primary-button/PrimaryButton.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import { motion } from 'framer-motion';
import { StyledPrimaryButtonProps } from '../../lib/types';

const StyledPrimaryButton = styled(motion.button)<StyledPrimaryButtonProps>`
color: ${colors.HEADER_FOOTER_BLUE};
background-color: ${colors.BUTTON_GREEN};
border-color: ${colors.HEADER_FOOTER_BLUE};
color: ${(props): string =>
props.$transparent ? colors.BUTTON_YELLOW : colors.TEXT_DARKBLUE};
background-color: ${(props): string =>
props.$transparent ? colors.TRANSPARENT : colors.BUTTON_YELLOW};
border-color: ${colors.BUTTON_YELLOW} !important;
font-family: ${fonts.nunitoSansSemibold};
transition-duration: 0.5s;
&:hover {
color: ${colors.BUTTON_GREEN};
background-color: ${colors.HEADER_FOOTER_BLUE};
border-color: ${colors.BUTTON_GREEN};
color: ${colors.TEXT_DARKBLUE};
background-color: ${colors.BUTTON_DARK_YELLOW};
border-color: ${colors.BUTTON_DARK_YELLOW} !important;
}
padding-right: ${(props): string =>
props.$isSmallPrimary ? '1.5em' : '1em'};
Expand All @@ -31,4 +33,4 @@ const StyledPrimaryButton = styled(motion.button)<StyledPrimaryButtonProps>`
}
`;

export { StyledPrimaryButton };
export { StyledPrimaryButton };
6 changes: 4 additions & 2 deletions shared-ui/components/primary-button/PrimaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const PrimaryButton: React.FC<ButtonProps> = ({
btnText,
btnLink,
newTab = false,
isSmallPrimary = false
isSmallPrimary = false,
transparent = false
}) => {
const [isClicked, setIsClicked] = useState(false);
if (!btnLink) {
Expand All @@ -27,7 +28,7 @@ const PrimaryButton: React.FC<ButtonProps> = ({
};
return (
<a onClick={onClick}>
<StyledPrimaryButton $isSmallPrimary={isSmallPrimary}>
<StyledPrimaryButton $isSmallPrimary={isSmallPrimary} $transparent={transparent}>
{ctaText}
</StyledPrimaryButton>
</a>
Expand All @@ -41,6 +42,7 @@ const PrimaryButton: React.FC<ButtonProps> = ({
whileTap="tap"
variants={buttonAnimations}
$isSmallPrimary={isSmallPrimary}
$transparent={transparent}
>
{btnText}
</StyledPrimaryButton>
Expand Down
2 changes: 2 additions & 0 deletions shared-ui/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { MouseEventHandler } from 'react';

export interface StyledPrimaryButtonProps {
$isSmallPrimary: boolean | undefined;
$transparent: boolean | undefined;
}

export interface ButtonProps {
Expand All @@ -11,6 +12,7 @@ export interface ButtonProps {
onClick?: MouseEventHandler;
isSmallPrimary?: boolean;
isClickable?: boolean;
transparent?: boolean;
}

export interface TimeRemainingProps {
Expand Down
7 changes: 6 additions & 1 deletion shared-ui/style/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ const colors = {
ORANGE: '#FFA500',
LIGHT_BLUE: '#ADD8E6',
PURPLE_TAG: '#800080',
RACE_LINE: '#ffe799'
RACE_LINE: '#ffe799',

// for primary button
BUTTON_YELLOW: '#FABB32',
BUTTON_DARK_YELLOW: '#F4A939',
TRANSPARENT: 'transparent'
};

export { colors };