mars-v2-frontend/src/components/Text.tsx
Linkie Link 21268e5536
UI style updates (#106)
* feat: updates on the button styles

* env: updated yarn.lock

* fix: added account actions

* fix: updated the orbs logic

* fix: fixed the blur presets

* feat: updated the button logic

* fix: wallet modal style adjustments

* fix: updated close icon

* fix: fixed the close button

* fix: fix types

* fix: fixed the build

* tidy: component cleanup

* feat:  added new AccountDetails component

* refactor: propper usage of tailwind

* refactor: imports

* feat: added pages for all scenarios

* fix: fix the loading component

* fix: remove loading from default trade

* fix: fixed the build

* fix: fixed losing the provider on hotplug

* tidy: remove unused code

* fix: added error messages

* add borrow page structure

* env: enhanced debugging by restructuring the ENV object

* fix: fixed the build

* fix: fixed the wording on missing env variables

* feat: added button hover (#112)

* feat: added button hover

* fix: added bg transition to primary buttons

* feat: pages refactored (#111)

* feat: pages refactored

* fix: added loader for AccountNavigation

* fix: fixed the wallet store management

* fix: get rid of the walletSlice and refactor

* fix: added gap to the borrow page

* fix: fixed some dependencies

* fix: added initClients back

* fix: fixed according to feedback

---------

Co-authored-by: bwvdhelm <34470358+bobthebuidlr@users.noreply.github.com>
2023-03-08 10:44:39 +01:00

40 lines
938 B
TypeScript

import classNames from 'classnames'
import { ReactNode } from 'react'
interface Props {
children: ReactNode | string
className?: string
monospace?: boolean
size?: '3xs' | '2xs' | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '6xl'
tag?: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4'
uppercase?: boolean
}
const headlines = ['h1', 'h2', 'h3', 'h4']
const headMap = ['6xl', '5xl', '4xl', '3xl']
export const Text = ({
children,
className,
monospace = false,
size = 'base',
tag = 'p',
uppercase = false,
}: Props) => {
const tagIndex = headlines.indexOf(tag)
const sizeClass = tagIndex > -1 ? headMap[tagIndex] : size
const HtmlElement = tag as keyof JSX.IntrinsicElements
return (
<HtmlElement
className={classNames(
className,
uppercase ? `text-${sizeClass}-caps` : `text-${sizeClass}`,
monospace && 'number',
)}
>
{children}
</HtmlElement>
)
}