Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Oct 13, 2023
1 parent f27d07d commit e94f015
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/toast/Toast.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Button } from '../buttonv2/Buttonv2.component';
import { Icon, IconColor } from '../icon/Icon.component';
import { BasicText } from '../text/Text.component';
import { ToastPosition, positionOutput } from './ToastPositionHelpers';
import { ToastProgressBar } from './ToastProgressBar';
import { DurationBasedProgressBar } from './ToastProgressBar';
import { useToastParameters } from './useToastParameters';
import styled from 'styled-components';

Expand Down Expand Up @@ -168,7 +168,7 @@ function Toast({
</Box>
</motion.div>
{withProgressBar && (
<ToastProgressBar
<DurationBasedProgressBar
duration={autoDismiss ? duration : null}
color={bgColor}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/lib/components/toast/ToastPositionHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { CSSProperties } from 'react';

export type ToastPosition =
| 'top-left'
| 'top-right'
Expand All @@ -6,7 +8,7 @@ export type ToastPosition =
| 'bottom-right'
| 'bottom-center';

export const positionOutput: Record<ToastPosition, {}> = {
export const positionOutput: Record<ToastPosition, CSSProperties> = {
'top-left': {
top: '3rem',
left: '1rem',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/toast/ToastProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { darken } from 'polished';
import { useEffect, useState } from 'react';
import { ProgressBar } from '../progressbar/ProgressBar.component';

export function ToastProgressBar({
export function DurationBasedProgressBar({
duration,
color,
}: {
Expand Down

0 comments on commit e94f015

Please sign in to comment.