Skip to content

Commit

Permalink
v7.4.0 (#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
platschi authored Jul 13, 2023
1 parent b02dc80 commit 5d78927
Show file tree
Hide file tree
Showing 135 changed files with 14,983 additions and 4,001 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "kwenta",
"version": "7.3.6",
"version": "7.4.0",
"description": "Kwenta",
"main": "index.js",
"scripts": {
"check-types": "pnpm run --filter \"@kwenta/*\" check-types",
"prepare": "husky install",
"format": "prettier --write \"**/*.{ts,tsx}\"",
"lint": "eslint . --ext ts,.tsx && pnpm check-types",
"lint:fix": "eslint packages --ext ts,.tsx --fix"
"lint:fix": "eslint packages --ext ts,.tsx --fix",
"dev": "pnpm run --filter \"@kwenta/*\" --stream --parallel dev"
},
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/assets/svg/app/caret-down-color-slim.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 11 additions & 14 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kwenta/app",
"version": "7.3.6",
"version": "7.4.0",
"scripts": {
"dev": "next",
"build": "next build",
Expand All @@ -19,8 +19,6 @@
"@eth-optimism/contracts": "0.5.37",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@gnosis.pm/safe-apps-provider": "^0.14.0",
"@gnosis.pm/safe-apps-sdk": "^7.8.0",
"@kwenta/sdk": "workspace:*",
"@material-ui/core": "^4.12.4",
"@pythnetwork/pyth-evm-js": "1.17.0",
Expand All @@ -41,7 +39,7 @@
"date-fns": "2.21.3",
"date-fns-tz": "2.0.0",
"echarts": "5.4.2",
"eslint-config-next": "^13.4.6",
"eslint-config-next": "^13.4.8",
"ethcall": "4.7.2",
"ethers": "5.7.2",
"graphql-request": "3.4.0",
Expand All @@ -50,24 +48,24 @@
"lightweight-charts": "4.0.1",
"lodash": "4.17.21",
"moment-business-time": "2.0.0",
"next": "^13.3.4",
"next": "^13.4.8",
"next-compose-plugins": "2.2.1",
"next-connect": "^0.13.0",
"next-transpile-modules": "10.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "12.1.1",
"react-infinite-scroll-component": "^6.1.0",
"react-is": "^18.0.0",
"react-is": "^18.2.0",
"react-query": "3.39.3",
"react-redux": "8.1.1",
"react-responsive": "^9.0.2",
"react-rnd": "^10.3.7",
"react-rnd": "^10.4.1",
"react-select": "4.3.1",
"react-slick": "0.29.0",
"react-table": "7.7.0",
"react-toastify": "^9.0.4",
"recharts": "^2.5.0",
"react-toastify": "^9.1.3",
"recharts": "^2.7.2",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"slick-carousel": "1.8.1",
Expand All @@ -90,8 +88,8 @@
"@testing-library/react": "14.0.0",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.4.3",
"@typechain/ethers-v5": "^10.1.0",
"@types/cors": "^2.8.12",
"@typechain/ethers-v5": "^10.2.1",
"@types/cors": "^2.8.13",
"@types/date-fns": "2.6.0",
"@types/ethereum-block-by-date": "^1.4.1",
"@types/jest": "27.0.2",
Expand All @@ -103,17 +101,16 @@
"@types/react-rnd": "^8.0.0",
"@types/react-select": "3.0.19",
"@types/react-slick": "0.23.10",
"@types/react-table": "7.0.22",
"@types/redux-logger": "^3.0.9",
"@types/styled-components": "5.1.26",
"@types/styled-components": "^5.1.26",
"@types/testing-library__jest-dom": "^5.14.6",
"css-loader": "^6.8.1",
"eslint-config-turbo": "1.10.6",
"html-to-image": "1.11.11",
"jest": "28.1.0",
"jest-environment-jsdom": "28.1.0",
"jest-preview": "^0.3.1",
"jest-transformer-svg": "^2.0.0",
"jest-transformer-svg": "^2.0.1",
"next-router-mock": "0.9.3",
"pinst": "3.0.0",
"postcss": "^8.4.24",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions packages/app/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type ButtonVariant =
| 'yellow'
| 'long'
| 'short'
| 'staking-button'

type BaseButtonProps = {
$size: 'xsmall' | 'small' | 'medium' | 'large'
Expand All @@ -25,6 +26,7 @@ type BaseButtonProps = {
fullWidth?: boolean
noOutline?: boolean
textColor?: 'yellow'
outlineColor?: 'yellow'
textTransform?: 'none' | 'uppercase' | 'capitalize' | 'lowercase'
$active?: boolean
$mono?: boolean
Expand Down Expand Up @@ -151,9 +153,8 @@ const BaseButton = styled.button<BaseButtonProps>`
}
`}
${(props) =>
props.$variant === 'yellow' &&
(props.$variant === 'yellow' || props.$variant === 'staking-button') &&
css`
background: ${props.theme.colors.selectedTheme.button.yellow.fill};
border: 1px solid ${props.theme.colors.selectedTheme.button.yellow.border};
Expand All @@ -166,6 +167,11 @@ const BaseButton = styled.button<BaseButtonProps>`
&::before {
display: none;
}
${props.$variant === 'staking-button' &&
css`
border: 1px solid ${props.theme.colors.selectedTheme.button.yellow.text};
`}
`}
font-family: ${(props) =>
Expand Down Expand Up @@ -233,6 +239,7 @@ type ButtonProps = {
fullWidth?: boolean
noOutline?: boolean
textColor?: 'yellow'
outlineColor?: 'yellow'
textTransform?: 'none' | 'uppercase' | 'capitalize' | 'lowercase'
style?: React.CSSProperties
disabled?: boolean
Expand Down
18 changes: 17 additions & 1 deletion packages/app/src/components/Button/TabButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type TabButtonProps = {
isRounded?: boolean
onClick?: () => any
flat?: boolean
variant?: 'noOutline'
}

const InnerButton: React.FC<TabButtonProps> = React.memo(
Expand Down Expand Up @@ -63,6 +64,7 @@ const TabButton: React.FC<TabButtonProps> = React.memo(
$nofill={props.nofill}
$flat={flat}
onClick={onClick}
$variant={props.variant}
>
<InnerButton {...props} />
</StyledButton>
Expand Down Expand Up @@ -127,6 +129,7 @@ const sharedStyle = css<{
&:hover {
background: ${(props) =>
props.theme.colors.selectedTheme.newTheme.button.default.hover.background};
border-width: 1px;
}
.title {
Expand Down Expand Up @@ -168,7 +171,10 @@ const sharedStyle = css<{
`}
`

const InlineTab = styled.div`
const InlineTab = styled.div<{
active?: boolean
$iconOnly?: boolean
}>`
${sharedStyle}
cursor: pointer;
border-right: ${(props) => props.theme.colors.selectedTheme.border};
Expand All @@ -181,6 +187,7 @@ const StyledButton = styled(Button).attrs({ size: 'small' })<{
$nofill?: boolean
$flat?: boolean
active?: boolean
$variant?: 'noOutline' | undefined
}>`
p {
text-align: left;
Expand All @@ -191,6 +198,15 @@ const StyledButton = styled(Button).attrs({ size: 'small' })<{
border-radius: ${props.isRounded ? '100px' : '8px'};
`}
${sharedStyle}
${(props) =>
props.$variant === 'noOutline' &&
css`
border: none;
border-radius: 100px;
padding: 10px 15px;
width: 75px;
`}
`

export default TabButton
45 changes: 40 additions & 5 deletions packages/app/src/components/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, memo } from 'react'
import styled from 'styled-components'
import styled, { css } from 'styled-components'

import { Body } from 'components/Text'

Expand All @@ -8,18 +8,35 @@ type CheckboxProps = {
label: string
checked: boolean
checkSide?: 'left' | 'right'
variant?: 'item' | 'table'
onChange: () => void
}

export const Checkbox: FC<CheckboxProps> = memo(
({ id, label, checked, onChange, checkSide = 'left', ...props }) => (
({ id, label, checked, onChange, checkSide = 'left', variant = 'item', ...props }) => (
<CheckboxContainer>
{checkSide === 'left' && (
<Input type="checkbox" id={id} name={id} checked={checked} onChange={onChange} {...props} />
<Input
type="checkbox"
id={id}
name={id}
checked={checked}
onChange={onChange}
variant={variant}
{...props}
/>
)}
<Label htmlFor={id}>{<Body color="secondary">{label}</Body>}</Label>
{checkSide === 'right' && (
<Input type="checkbox" id={id} name={id} checked={checked} onChange={onChange} {...props} />
<Input
type="checkbox"
id={id}
name={id}
checked={checked}
onChange={onChange}
variant={variant}
{...props}
/>
)}
</CheckboxContainer>
)
Expand All @@ -34,7 +51,7 @@ const CheckboxContainer = styled.div`
gap: 8px;
`

const Input = styled.input`
const Input = styled.input<{ variant: 'item' | 'table' }>`
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
Expand Down Expand Up @@ -66,9 +83,27 @@ const Input = styled.input`
box-shadow: inset 1em 1em var(--form-control-color);
background-color: ${(props) => props.theme.colors.selectedTheme.newTheme.text.primary};
}
&:checked::before {
transform: scale(1);
}
${(props) =>
props.variant === 'table' &&
css`
background-color: ${(props) => props.theme.colors.selectedTheme.newTheme.checkBox.background};
width: 13px;
height: 13px;
border-radius: 4px;
&::before {
clip-path: none;
}
&:checked::before {
background-color: ${props.theme.colors.selectedTheme.newTheme.checkBox.checked};
border-radius: 4px;
}
`}
`

const Label = styled.label`
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/components/ColoredPrice.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import styled from 'styled-components'

import { PricesInfo } from 'state/prices/types'
import { PriceChange } from 'state/prices/types'

export const getColorFromPriceInfo = (priceInfo: PricesInfo | undefined) => {
return !priceInfo?.change ? 'white' : priceInfo.change === 'up' ? 'green' : 'red'
export const getColorFromPriceChange = (change?: PriceChange) => {
return !change ? 'white' : change === 'up' ? 'green' : 'red'
}

const ColoredPrice = styled.div<{ priceInfo: PricesInfo | undefined }>`
const ColoredPrice = styled.div<{ priceChange?: PriceChange }>`
font-size: 13px;
font-family: ${(props) => props.theme.fonts.mono};
color: ${(props) => {
const color = getColorFromPriceInfo(props.priceInfo)
const color = getColorFromPriceChange(props.priceChange)
return props.theme.colors.selectedTheme[color]
}};
`
Expand Down
8 changes: 8 additions & 0 deletions packages/app/src/components/Media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const DesktopOnlyView: FC<MediaProps> = memo(({ children }) => (
<MediaQuery minWidth={BREAKPOINTS.md}>{children}</MediaQuery>
))

export const DesktopLargeOnlyView: FC<MediaProps> = memo(({ children }) => (
<MediaQuery minWidth={BREAKPOINTS.lg}>{children}</MediaQuery>
))

export const DesktopSmallOnlyView: FC<MediaProps> = memo(({ children }) => (
<MediaQuery maxWidth={BREAKPOINTS.lg}>{children}</MediaQuery>
))

export const TabletOnlyView: FC<MediaProps> = memo(({ children }) => (
<MediaQuery minWidth={BREAKPOINTS.sm} maxWidth={BREAKPOINTS.md - 1}>
{children}
Expand Down
20 changes: 16 additions & 4 deletions packages/app/src/components/Nav/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Link from 'next/link'
import React, { ReactNode } from 'react'
import styled from 'styled-components'

import LinkIconLight from 'assets/svg/app/link-light.svg'
import { FlexDivRowCentered } from 'components/layout/flex'
import { linkCSS } from 'styles/common'

type NavButtonProps = {
Expand All @@ -16,15 +18,25 @@ type NavButtonProps = {
const NavButton: React.FC<NavButtonProps> = ({ title, href, external, disabled, ...props }) => {
return (
<div>
<Link href={href} passHref>
{external ? (
<StyledLink
target={external ? '_blank' : '_self'}
href={href}
target="_blank"
rel="noopener noreferrer"
className={disabled ? 'disabled' : undefined}
{...props}
>
{title}
<FlexDivRowCentered columnGap="5px">
{title} <LinkIconLight />
</FlexDivRowCentered>
</StyledLink>
</Link>
) : (
<Link href={href} passHref>
<StyledLink className={disabled ? 'disabled' : undefined} {...props}>
{title}
</StyledLink>
</Link>
)}
</div>
)
}
Expand Down
Loading

1 comment on commit 5d78927

@vercel
Copy link

@vercel vercel bot commented on 5d78927 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./packages/app

kwenta-git-main-kwenta.vercel.app
kwenta.io
kwenta-kwenta.vercel.app

Please sign in to comment.