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
2 changes: 1 addition & 1 deletion src/app/global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const GlobalError = ({ error, reset }: GlobalErrorViewProps) => {
locales={languages as unknown as Intl.LanguagesKeys[]}
>
<div className='width-container flex flex-1'>
<div className="flex flex-col items-center justify-center m-auto max-w-[520rem]">
<div className="flex flex-col items-center justify-center m-auto max-w-[520px]">
<Text
className="text-center"
message={messages.error.title}
Expand Down
6 changes: 3 additions & 3 deletions src/components/AmountInput/AmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AmountInput: React.FC<AmountInputProps> = (props) => {
} = props

const controlId = useId()
const { isMobile } = device.useData()
const { isDesktop } = device.useData()
const testId = dataTestId || `input-${controlId}`
const inputRef = useRef<HTMLInputElement>(null)

Expand All @@ -38,8 +38,8 @@ const AmountInput: React.FC<AmountInputProps> = (props) => {
className={cx(s.input, className, 'w-full', {
'text-dark': !error,
'text-error': error,
'text-h20': isMobile,
'text-t40m': !isMobile,
'text-h20': !isDesktop,
'text-t40m': isDesktop,
})}
ref={inputRef}
placeholder="0"
Expand Down
4 changes: 2 additions & 2 deletions src/components/AutoHeightToggle/AutoHeightToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ const AutoHeightToggle: React.FC<AutoHeightToggleProps> = (props) => {
const marginTop = parseFloat(getComputedStyle(contentRef.current as HTMLDivElement).marginTop)

if (containerRef.current) {
containerRef.current.style.height = `calc(${padding * 2}rem + ${contentHeight + containerHeight + marginTop}px)`
containerRef.current.style.height = `calc(${padding * 2}px + ${contentHeight + containerHeight + marginTop}px)`
}
}
else {
const height = childrenRef.current?.clientHeight

if (containerRef.current) {
containerRef.current.style.height = `calc(${padding * 2}rem + ${height}px)`
containerRef.current.style.height = `calc(${padding * 2}px + ${height}px)`
}
}
}, [ isOpen, toggleContent ])
Expand Down
2 changes: 1 addition & 1 deletion src/components/Bone/Bone.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

@keyframes bone {
0% {
transform: translateY(6rem) scale(0.98);
transform: translateY(6px) scale(0.98);
opacity: .2;
}
85%,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Bone/Bone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const Bone: React.FC<BoneProps> = (props: any) => {
const style: any = styles

if (width) {
style.width = style.minWidth = `${width}rem`
style.width = style.minWidth = `${width}px`
}

if (height) {
style.height = style.minHeight = `${height}rem`
style.height = style.minHeight = `${height}px`
}

return style
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ const Button: React.FC<ButtonProps> = (props) => {
}, [ loading, disabled, color ])

const buttonSizeClassName = cx({
'min-w-[28rem] h-[28rem]': size === 'xs',
'min-w-[28px] h-[28px]': size === 'xs',
'min-w-32 h-32': size === 's',
'min-w-[44rem] h-[44rem]': size === 'm',
'min-w-[44px] h-[44px]': size === 'm',
'min-w-60 h-60': size === 'l',
'min-w-[70rem] h-[70rem]': size === 'xl',
'min-w-[70px] h-[70px]': size === 'xl',
})

const buttonPaddingClassName = cx({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.rounded {
border-radius: 11rem;
border-radius: 11px;
}
2 changes: 1 addition & 1 deletion src/components/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Chart: React.FC<ChartProps> = (props) => {
<div
ref={containerRef}
className={cx(className, 'relative w-full')}
style={{ minHeight: `${height || 340}rem` }}
style={{ minHeight: `${height || 340}px` }}
data-testid={dataTestId}
onMouseOver={showLegend}
onMouseLeave={hideLegend}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.value {
min-width: 70rem;
min-width: 70px;
}
8 changes: 4 additions & 4 deletions src/components/Chart/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ type SkeletonProps = {
}

const Skeleton: React.FC<SkeletonProps> = ({ className }) => {
const { isMobile } = device.useData()
const columns = isMobile ? 4 : 6
const { isDesktop } = device.useData()
const columns = isDesktop ? 6 : 4

return (
<div className={className}>
Expand All @@ -27,7 +27,7 @@ const Skeleton: React.FC<SkeletonProps> = ({ className }) => {
key={index}
className="absolute bottom-4 mb-48"
style={{
height: `${50 + index * 30}rem`,
height: `${50 + index * 30}px`,
left: `${Math.max(((index / columns) * 95), 4)}%`,
width: `${50 / columns}%`,
}}
Expand All @@ -44,7 +44,7 @@ const Skeleton: React.FC<SkeletonProps> = ({ className }) => {
<Bone className="w-full h-20" />
</div>
<div className="absolute top-4 left-4 w-full">
<Bone className="w-[140rem] h-24" />
<Bone className="w-[140px] h-24" />
<Bone className="mt-12 w-80 h-16" />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Counter/Counter.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.counter {
min-width: 20rem;
height: 20rem;
min-width: 20px;
height: 20px;

@include dark-theme {
color: $color-dark;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Dropdown/Option/Option.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.option {
min-width: 160rem;
height: 48rem;
min-width: 160px;
height: 48px;

&:hover,
&:focus {
Expand All @@ -9,7 +9,7 @@
}

.withSubTitle {
height: 52rem;
height: 52px;
}

.logo {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Image/util/getImageStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Input = {
}

const getImageStyle = ({ size, color, imageUrl }: Input) => {
const remSize = size ? `${size}rem` : undefined
const remSize = size ? `${size}px` : undefined

const dimensions: CSSProperties = {
width: remSize,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/InputButton/InputButton.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.button {
height: 24rem;
height: 24px;
background-color: rgba($color-dark-rgb, .06);
}
14 changes: 7 additions & 7 deletions src/components/Input/InputView/InputView.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ $bg-color-error-hover: rgba($color-error-rgb, .15);
@include field-colors($border-color-default, $bg-color-default);

&.isMultiline {
min-height: 20rem;
min-height: 20px;

.crossButton {
top: 12rem;
right: 16rem;
top: 12px;
right: 16px;
}
}

&:not(.isMultiline) {
height: 48rem;
height: 48px;
}

&:not(.disabled) {
Expand Down Expand Up @@ -60,7 +60,7 @@ $bg-color-error-hover: rgba($color-error-rgb, .15);
&.focused {

.label {
top: 5rem;
top: 5px;
}
}

Expand All @@ -74,7 +74,7 @@ $bg-color-error-hover: rgba($color-error-rgb, .15);
}

.label {
top: 14rem;
top: 14px;
pointer-events: none;
@include basic-transition();
}
Expand All @@ -88,7 +88,7 @@ $bg-color-error-hover: rgba($color-error-rgb, .15);
caret-color: $color-dark;

&.isMultiline {
line-height: 20rem;
line-height: 20px;
}

&:focus {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MenuDropdown/Option/Option.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.option {
min-width: 160rem;
min-width: 160px;

@media (hover: hover) {
&:hover {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MenuDropdown/Option/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Option: React.FC<OptionProps> = (props) => {
className={cx(s.option, className, 'flex items-center pl-16 pr-24 cursor-pointer', {
'bg-primary/10': active,
'h-48': !subTitle,
'h-[52rem]': subTitle,
'h-[52px]': subTitle,
})}
data-testid={dataTestId}
onClick={onClick}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Content/Buttons/Buttons.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@include desktop {
.button {
min-width: 210rem;
min-width: 210px;
}
}
4 changes: 2 additions & 2 deletions src/components/Modal/Content/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Content: React.FC<ContentProps> = (props) => {
handleClose,
} = props

const { isMobile } = device.useData()
const { isDesktop } = device.useData()

const isWide = size === 'wide'
const isNarrow = size === 'narrow'
Expand Down Expand Up @@ -119,7 +119,7 @@ const Content: React.FC<ContentProps> = (props) => {
<Description
as="div"
className={cx(contentClassName, 'mt-24 relative h-full', {
'flex-1': isMobile,
'flex-1': !isDesktop,
})}
>
{isNarrow && descriptionNode}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Modal/Modal.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.overlay {
overflow-y: auto;
-webkit-backdrop-filter: blur(28rem);
backdrop-filter: blur(28rem);
-webkit-backdrop-filter: blur(28px);
backdrop-filter: blur(28px);
@include fade-in(animation, 300ms, ease);

@include light-theme {
Expand Down Expand Up @@ -51,10 +51,10 @@
@include desktop {

.narrow {
width: 480rem;
width: 480px;
}

.wide {
width: 800rem;
width: 800px;
}
}
6 changes: 3 additions & 3 deletions src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Modal: React.FC<ModalProps> = (props) => {
// This state use for animation
const [ isOpen, setIsOpen ] = useState(true)

const { isMobile, isDesktop } = device.useData()
const { isDesktop } = device.useData()

useEffect(() => {
// Headless UI Dialog sets the #global-wrapper to inert,
Expand Down Expand Up @@ -117,8 +117,8 @@ const Modal: React.FC<ModalProps> = (props) => {
>
<DialogPanel
className={cx(className, s.modal, 'relative m-auto p-24 bg-modal', s[size], {
'rounded-16': !isMobile,
'flex flex-col': isMobile,
'rounded-16': isDesktop,
'flex flex-col': !isDesktop,
})}
data-testid={dataTestId}
>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Notification/Notification.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.notification {
min-width: 210rem;
max-width: 560rem;
min-width: 210px;
max-width: 560px;
background-color: $color-light;
animation: openNotification 500ms ease;

Expand Down Expand Up @@ -34,8 +34,8 @@

.closeButton {
top: 50%;
right: 16rem;
margin-top: -12rem;
right: 16px;
margin-top: -12px;
background-color: rgba($color-dark-rgb, .05);
pointer-events: auto;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/PercentInput/PercentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type PercentInputProps = {
}

const PercentInput: React.FC<PercentInputProps> = ({ field, isDisabled, dataTestId }) => {
const { isMobile } = device.useData()
const { isDesktop } = device.useData()

const { value, error } = forms.useFieldValue(field)

Expand Down Expand Up @@ -106,12 +106,12 @@ const PercentInput: React.FC<PercentInputProps> = ({ field, isDisabled, dataTest

return (
<div
className="pt-16 px-16 pb-12 flex flex-col justify-between bg-dark/5 rounded-8 h-[108rem]"
className="pt-16 px-16 pb-12 flex flex-col justify-between bg-dark/5 rounded-8 h-[108px]"
data-testid={dataTestId}
>
<div
className={cx('flex justify-between items-center w-full gap-8', {
'pt-8': isMobile,
'pt-8': !isDesktop,
})}
>
<AmountInput
Expand Down
4 changes: 2 additions & 2 deletions src/components/PopupInfo/PopupInfo.module.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@include desktop {
.container {
min-width: 347rem;
min-width: 347px;
}
}

@include except-desktop {
.container {
min-width: 270rem;
min-width: 270px;
max-width: 100%;
}
}
6 changes: 3 additions & 3 deletions src/components/PopupInfo/PopupInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export type PopupInfoProps = {
const PopupInfo: React.FC<PopupInfoProps> = (props) => {
const { className, buttonClassName, childClassName, headNode, children } = props

const { isMobile } = device.useData()
const { isDesktop } = device.useData()
const [ isOpen, setIsOpen ] = useState(false)

const { refs, floatingStyles, context } = useFloating({
open: isOpen,
placement: isMobile ? 'top' : 'top-end',
placement: isDesktop ? 'top-end' : 'top',
middleware: [
offset(10),
flip({
Expand Down Expand Up @@ -94,7 +94,7 @@ const PopupInfo: React.FC<PopupInfoProps> = (props) => {
{children}
</div>
{
isMobile && (
!isDesktop && (
<ButtonBase
className="absolute -top-40 right-0 rounded-full bg-background p-4 border border-dark/10"
ariaLabel={messages.closePopup}
Expand Down
Loading
Loading