Skip to content

Commit

Permalink
Merge branch 'main' of github.com:thesis/acre into init-overview-page
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Dec 6, 2023
2 parents 832da1e + a5e5ef0 commit d2f2735
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
33 changes: 33 additions & 0 deletions dapp/src/components/Typography/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable react/jsx-props-no-spreading */
import React from "react"
import { Text, TextProps } from "@chakra-ui/react"

export function TextXl(props: TextProps) {
return (
<Text as="p" fontWeight="medium" fontSize="xl" lineHeight="xl" {...props} />
)
}

export function TextLg(props: TextProps) {
return (
<Text as="p" fontWeight="medium" fontSize="lg" lineHeight="lg" {...props} />
)
}

export function TextMd(props: TextProps) {
return (
<Text as="p" fontWeight="medium" fontSize="md" lineHeight="md" {...props} />
)
}

export function TextSm(props: TextProps) {
return (
<Text as="p" fontWeight="medium" fontSize="sm" lineHeight="sm" {...props} />
)
}

export function TextXs(props: TextProps) {
return (
<Text as="p" fontWeight="medium" fontSize="xs" lineHeight="xs" {...props} />
)
}
5 changes: 4 additions & 1 deletion dapp/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import { StyleFunctionProps, Tooltip, extendTheme } from "@chakra-ui/react"
import { mode } from "@chakra-ui/theme-tools"
import Button from "./Button"
import Switch from "./Switch"
import { colors } from "./utils"
import { colors, fontSizes, fontWeights, lineHeights } from "./utils"

// Currently, there is no possibility to set all tooltips with hasArrow by defaultProps.
// Let's override the defaultProps as follows.
Tooltip.defaultProps = { ...Tooltip.defaultProps, hasArrow: true }

const defaultTheme = {
colors,
fontSizes,
fontWeights,
lineHeights,
styles: {
global: (props: StyleFunctionProps) => ({
body: {
Expand Down
22 changes: 22 additions & 0 deletions dapp/src/theme/utils/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const fontSizes = {
xs: "0.75rem",
sm: "0.875rem",
md: "1rem",
lg: "1.125rem",
xl: "1.25rem",
}

export const fontWeights = {
medium: 500,
semibold: 600,
bold: 700,
black: 900,
}

export const lineHeights = {
xs: "1.125rem",
sm: "1.25rem",
md: "1.5rem",
lg: "1.75rem",
xl: "1.875rem",
}
1 change: 1 addition & 0 deletions dapp/src/theme/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./colors"
export * from "./fonts"

0 comments on commit d2f2735

Please sign in to comment.