From c66c63e33aa3cf976999114f8c71d71d8ad072ed Mon Sep 17 00:00:00 2001 From: Ape Fede Date: Wed, 7 Dec 2022 14:21:48 -0300 Subject: [PATCH 1/6] chore: Fixed LpTag --- src/components/Tag/LpTag.tsx | 8 ++------ src/components/Tag/index.stories.tsx | 6 +++--- src/components/Tag/index.tsx | 2 +- src/components/Tag/styles.tsx | 18 +++++++++++------- src/components/Tag/types.ts | 12 +++++++++--- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/components/Tag/LpTag.tsx b/src/components/Tag/LpTag.tsx index 501df17f..686289cf 100644 --- a/src/components/Tag/LpTag.tsx +++ b/src/components/Tag/LpTag.tsx @@ -1,13 +1,9 @@ import React from "react"; import { useTheme } from "styled-components"; import { StyledLpTag, LightText, DarkText } from "./styles"; -import { LpTypeVariants } from "./types"; +import { LpTagProps } from "./types"; -export interface LpTagProps { - variant?: LpTypeVariants; -} - -const LpTag: React.FC = ({ variant = LpTypeVariants.APE, ...props }) => { +const LpTag: React.FC = ({ variant, ...props }) => { const { isDark } = useTheme(); return ( diff --git a/src/components/Tag/index.stories.tsx b/src/components/Tag/index.stories.tsx index eaf80bad..cebbd46f 100644 --- a/src/components/Tag/index.stories.tsx +++ b/src/components/Tag/index.stories.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import { Meta } from "@storybook/react/types-6-0"; import { CommunityIcon, RemoveIcon } from "../Svg"; import Tag from "./Tag"; -import { LpTypeVariants, variants } from "./types"; +import { variants } from "./types"; import LpTag from "./LpTag"; const Row = styled.div` @@ -39,8 +39,8 @@ export const Default: React.FC = () => { ))} - - + + ); diff --git a/src/components/Tag/index.tsx b/src/components/Tag/index.tsx index aba1099e..18f557e8 100644 --- a/src/components/Tag/index.tsx +++ b/src/components/Tag/index.tsx @@ -1,4 +1,4 @@ export { default as Tag } from "./Tag"; export { default as LpTag } from "./LpTag"; export type { TagProps, Variants as TagVariants } from "./types"; -export { LpTypeVariants } from "./types"; +export type { LpTagVariants } from "./types"; diff --git a/src/components/Tag/styles.tsx b/src/components/Tag/styles.tsx index 05b9bcb3..d6a5dfd9 100644 --- a/src/components/Tag/styles.tsx +++ b/src/components/Tag/styles.tsx @@ -1,6 +1,6 @@ import styled, { DefaultTheme } from "styled-components"; import getColor from "../../util/getColor"; -import { LpTypeVariants, TagProps } from "./types"; +import { LpTagProps, TagProps } from "./types"; interface ThemedProps extends TagProps { theme: DefaultTheme; @@ -29,17 +29,21 @@ export const StyledTag = styled.div` } `; -export const StyledLpTag = styled.div<{ variant: LpTypeVariants }>` +interface CustomProps extends LpTagProps { + theme: DefaultTheme; +} + +export const StyledLpTag = styled.div` align-items: center; - background: ${({ theme, variant }) => theme?.colors?.lpTagBg[variant]}; + background: ${({ theme, variant = "ape" }) => theme?.colors?.lpTagBg?.[variant]}; border-radius: 6px; display: inline-flex; height: 15px; padding: 0 5px; `; -export const LightText = styled.div<{ variant: LpTypeVariants }>` - background: ${({ theme, variant }) => theme?.colors?.lpTagText[variant]}; +export const LightText = styled.div` + background: ${({ theme, variant = "ape" }) => theme?.colors?.lpTagText?.[variant]}; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-transform: uppercase; @@ -48,8 +52,8 @@ export const LightText = styled.div<{ variant: LpTypeVariants }>` line-height: 15px; `; -export const DarkText = styled.div<{ variant: LpTypeVariants }>` - color: ${({ theme, variant }) => theme?.colors?.lpTagText[variant]}; +export const DarkText = styled.div` + color: ${({ theme, variant = "ape" }) => theme?.colors?.lpTagText?.[variant]}; text-transform: uppercase; font-size: 10px; font-weight: 500; diff --git a/src/components/Tag/types.ts b/src/components/Tag/types.ts index 0d23f23d..6c48ab5f 100644 --- a/src/components/Tag/types.ts +++ b/src/components/Tag/types.ts @@ -20,7 +20,13 @@ export interface TagProps extends SpaceProps { outline?: boolean; } -export enum LpTypeVariants { - APE = "ape", - UNI = "uni", +export const lpTagVariants = { + APE: "ape", + UNI: "uni", +} as const; + +export type LpTagVariants = typeof lpTagVariants[keyof typeof lpTagVariants]; + +export interface LpTagProps extends SpaceProps { + variant?: LpTagVariants; } From b3af036f57eec06e446e18fd33771f2ffa53d1bd Mon Sep 17 00:00:00 2001 From: Ape Fede Date: Fri, 9 Dec 2022 11:59:26 -0300 Subject: [PATCH 2/6] chore: New Lp Tag colors --- src/components/Tag/types.ts | 2 +- src/theme/colors.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Tag/types.ts b/src/components/Tag/types.ts index 6c48ab5f..1a8e6f6b 100644 --- a/src/components/Tag/types.ts +++ b/src/components/Tag/types.ts @@ -28,5 +28,5 @@ export const lpTagVariants = { export type LpTagVariants = typeof lpTagVariants[keyof typeof lpTagVariants]; export interface LpTagProps extends SpaceProps { - variant?: LpTagVariants; + variant: LpTagVariants; } diff --git a/src/theme/colors.ts b/src/theme/colors.ts index 45a5f6af..5da78656 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -32,7 +32,7 @@ export const lightColors: Colors = { bubblegum: "linear-gradient(139.73deg, #E6FDFF 0%, #F3EFFF 100%)", }, lpTagBg: { - ape: "linear-gradient(53.53deg, rgba(161, 101, 82, 0.2) 15.88%, rgba(225, 178, 66, 0.2) 92.56%)", + ape: "linear-gradient(53.53deg, rgba(161, 101, 82, 0.35) 15.88%, rgba(225, 178, 66, 0.35) 92.56%)", uni: "rgba(213, 49, 113, 0.15)", }, lpTagText: { @@ -65,7 +65,7 @@ export const darkColors: Colors = { uni: "rgba(213, 49, 113, 0.15)", }, lpTagText: { - ape: "rgba(255, 255, 255, 0.5)", + ape: "rgba(255, 255, 255, 0.75)", uni: "#D53171", }, primaryButtonDisable: "rgba(241, 234, 218, 0.5)", From f44faf78243d4916f7f72ae5d6988a32439b348e Mon Sep 17 00:00:00 2001 From: Ape Fede Date: Wed, 14 Dec 2022 15:20:03 -0300 Subject: [PATCH 3/6] chore: Add new lptype tag --- src/components/Tag/LpTag.tsx | 11 ++--------- src/components/Tag/styles.tsx | 16 +++------------- src/theme/colors.ts | 16 ++++------------ src/theme/types.ts | 1 - 4 files changed, 9 insertions(+), 35 deletions(-) diff --git a/src/components/Tag/LpTag.tsx b/src/components/Tag/LpTag.tsx index 686289cf..364ef6f0 100644 --- a/src/components/Tag/LpTag.tsx +++ b/src/components/Tag/LpTag.tsx @@ -1,18 +1,11 @@ import React from "react"; -import { useTheme } from "styled-components"; -import { StyledLpTag, LightText, DarkText } from "./styles"; +import { StyledLpTag, StyledLPText } from "./styles"; import { LpTagProps } from "./types"; const LpTag: React.FC = ({ variant, ...props }) => { - const { isDark } = useTheme(); - return ( - {isDark ? ( - {variant} LP - ) : ( - {variant} LP - )} + {variant} LP ); }; diff --git a/src/components/Tag/styles.tsx b/src/components/Tag/styles.tsx index d6a5dfd9..f615ff90 100644 --- a/src/components/Tag/styles.tsx +++ b/src/components/Tag/styles.tsx @@ -42,20 +42,10 @@ export const StyledLpTag = styled.div` padding: 0 5px; `; -export const LightText = styled.div` - background: ${({ theme, variant = "ape" }) => theme?.colors?.lpTagText?.[variant]}; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; +export const StyledLPText = styled.div<{ theme: DefaultTheme }>` + color: ${({ theme }) => theme?.colors?.primaryBright}; text-transform: uppercase; font-size: 10px; - font-weight: 500; - line-height: 15px; -`; - -export const DarkText = styled.div` - color: ${({ theme, variant = "ape" }) => theme?.colors?.lpTagText?.[variant]}; - text-transform: uppercase; - font-size: 10px; - font-weight: 500; + font-weight: 600; line-height: 15px; `; diff --git a/src/theme/colors.ts b/src/theme/colors.ts index 5da78656..7a9f7536 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -32,12 +32,8 @@ export const lightColors: Colors = { bubblegum: "linear-gradient(139.73deg, #E6FDFF 0%, #F3EFFF 100%)", }, lpTagBg: { - ape: "linear-gradient(53.53deg, rgba(161, 101, 82, 0.35) 15.88%, rgba(225, 178, 66, 0.35) 92.56%)", - uni: "rgba(213, 49, 113, 0.15)", - }, - lpTagText: { - ape: "linear-gradient(53.53deg, #A16552 15.88%, #E1B242 92.56%)", - uni: "#D53171", + ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", + uni: "rgba(213, 49, 113, 0.8)", }, primaryButtonDisable: "rgba(66, 66, 66, 0.5)", secondaryButtonDisableBg: "#F1EADA", @@ -61,12 +57,8 @@ export const darkColors: Colors = { bubblegum: "linear-gradient(139.73deg, #313D5C 0%, #3D2A54 100%)", }, lpTagBg: { - ape: "linear-gradient(53.53deg, rgba(161, 101, 82, 0.5) 15.88%, rgba(225, 178, 66, 0.5) 92.56%)", - uni: "rgba(213, 49, 113, 0.15)", - }, - lpTagText: { - ape: "rgba(255, 255, 255, 0.75)", - uni: "#D53171", + ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", + uni: "rgba(213, 49, 113, 0.8)", }, primaryButtonDisable: "rgba(241, 234, 218, 0.5)", secondaryButtonDisableBg: "rgba(33, 33, 33, 0.5)", diff --git a/src/theme/types.ts b/src/theme/types.ts index cc6820f8..70fe3209 100644 --- a/src/theme/types.ts +++ b/src/theme/types.ts @@ -62,7 +62,6 @@ export type Colors = { yellowHover: string; input: string; lpTagBg: LpTagColors; - lpTagText: LpTagColors; // Gradients gradients?: Gradients; From 4ed029735e75c0bd5c86670420dea7a6f6feebe0 Mon Sep 17 00:00:00 2001 From: Ape Fede Date: Wed, 14 Dec 2022 15:26:28 -0300 Subject: [PATCH 4/6] chore: Add test file --- src/__tests__/widgets/menu.test.tsx | 100 ++++++++++++++-------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/__tests__/widgets/menu.test.tsx b/src/__tests__/widgets/menu.test.tsx index bdcd3fbe..bdc17024 100644 --- a/src/__tests__/widgets/menu.test.tsx +++ b/src/__tests__/widgets/menu.test.tsx @@ -52,10 +52,10 @@ it("renders correctly", () => { expect(asFragment()).toMatchInlineSnapshot(`
Stake
@@ -249,21 +249,21 @@ it("renders correctly", () => {
Raise
@@ -281,21 +281,21 @@ it("renders correctly", () => {
Collect
@@ -313,11 +313,11 @@ it("renders correctly", () => {
Explore
@@ -360,7 +360,7 @@ it("renders correctly", () => {
{ style="display: flex; align-items: center; justify-content: space-evenly; width: 200px;" > { { {
body
@@ -672,13 +672,13 @@ it("renders correctly", () => {
{ class="css-1rzh7ej" />
Date: Wed, 14 Dec 2022 18:41:08 -0300 Subject: [PATCH 5/6] chore: Add ARK lp type --- src/components/Tag/index.stories.tsx | 1 + src/components/Tag/types.ts | 1 + src/theme/colors.ts | 2 ++ src/theme/types.ts | 1 + 4 files changed, 5 insertions(+) diff --git a/src/components/Tag/index.stories.tsx b/src/components/Tag/index.stories.tsx index cebbd46f..bf891a46 100644 --- a/src/components/Tag/index.stories.tsx +++ b/src/components/Tag/index.stories.tsx @@ -41,6 +41,7 @@ export const Default: React.FC = () => { + ); diff --git a/src/components/Tag/types.ts b/src/components/Tag/types.ts index 1a8e6f6b..ca580070 100644 --- a/src/components/Tag/types.ts +++ b/src/components/Tag/types.ts @@ -23,6 +23,7 @@ export interface TagProps extends SpaceProps { export const lpTagVariants = { APE: "ape", UNI: "uni", + ARK: "ark", } as const; export type LpTagVariants = typeof lpTagVariants[keyof typeof lpTagVariants]; diff --git a/src/theme/colors.ts b/src/theme/colors.ts index 7a9f7536..af4b6e62 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -34,6 +34,7 @@ export const lightColors: Colors = { lpTagBg: { ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", uni: "rgba(213, 49, 113, 0.8)", + ark: "rgba(208, 126, 90, 0.8)", }, primaryButtonDisable: "rgba(66, 66, 66, 0.5)", secondaryButtonDisableBg: "#F1EADA", @@ -59,6 +60,7 @@ export const darkColors: Colors = { lpTagBg: { ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", uni: "rgba(213, 49, 113, 0.8)", + ark: "rgba(208, 126, 90, 0.8)", }, primaryButtonDisable: "rgba(241, 234, 218, 0.5)", secondaryButtonDisableBg: "rgba(33, 33, 33, 0.5)", diff --git a/src/theme/types.ts b/src/theme/types.ts index 70fe3209..366eba83 100644 --- a/src/theme/types.ts +++ b/src/theme/types.ts @@ -82,4 +82,5 @@ export type FontFamily = { export type LpTagColors = { ape: string; uni: string; + ark: string; }; From f7e148d1031ddf888a10bfc86faad337946947f7 Mon Sep 17 00:00:00 2001 From: Ape Fede Date: Thu, 15 Dec 2022 10:02:38 -0300 Subject: [PATCH 6/6] chore: Moved Lptag colors to base colors --- src/theme/colors.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/theme/colors.ts b/src/theme/colors.ts index af4b6e62..f380604d 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -13,6 +13,11 @@ export const baseColors = { inputBorder: "#E6DECB", brown: "#A16552", smartGradient: "linear-gradient(94.44deg, #BA801E -9.73%, #E7CF67 40.14%, #BA801E 93.01%)", + lpTagBg: { + ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", + uni: "rgba(213, 49, 113, 0.8)", + ark: "rgba(208, 126, 90, 0.8)", + }, }; export const brandColors = { @@ -31,11 +36,6 @@ export const lightColors: Colors = { newGradient: "linear-gradient(53.53deg, #A16552 15.88%, #E1B242 92.56%)", bubblegum: "linear-gradient(139.73deg, #E6FDFF 0%, #F3EFFF 100%)", }, - lpTagBg: { - ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", - uni: "rgba(213, 49, 113, 0.8)", - ark: "rgba(208, 126, 90, 0.8)", - }, primaryButtonDisable: "rgba(66, 66, 66, 0.5)", secondaryButtonDisableBg: "#F1EADA", secondaryButtonDisableColor: "rgba(66, 66, 66, 0.5)", @@ -57,11 +57,6 @@ export const darkColors: Colors = { gradients: { bubblegum: "linear-gradient(139.73deg, #313D5C 0%, #3D2A54 100%)", }, - lpTagBg: { - ape: "linear-gradient(99.09deg, rgba(161, 101, 82, 0.8) 0%, rgba(255, 179, 0, 0.8) 106.96%)", - uni: "rgba(213, 49, 113, 0.8)", - ark: "rgba(208, 126, 90, 0.8)", - }, primaryButtonDisable: "rgba(241, 234, 218, 0.5)", secondaryButtonDisableBg: "rgba(33, 33, 33, 0.5)", secondaryButtonDisableColor: "#F1EADA",