Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Aug 7, 2024
1 parent 347cf66 commit 37b8920
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React from 'react'

import { Button } from '../Button/Button'
import { Snackbar, SnackbarProps } from './Snackbar'
import { useSnackbar } from '../../hooks/useSnackbar'
import { generateDocs } from '../../utils/storybook'
import { useSnackbar } from '../../hooks/useSnackbar'

const meta: Meta<SnackbarProps> = {
title: 'Snackbar',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/Snackbar/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Icon, IconProps } from '../Icon/Icon'
import { Spacer } from '../Spacer/Spacer'
import { useTheme } from '../../utils'

// let snackbarOffset: number = 10
// TODO: Replace with global setting
export const DEFAULT_OFFSET: number = 50

type snackbarData = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { createContext, useState, ReactNode } from 'react'
import React, { ReactNode, createContext, useState } from 'react'

import { DEFAULT_OFFSET, Snackbar } from './Snackbar'
import { ToastProvider } from 'react-native-toast-notifications'
import { Snackbar, DEFAULT_OFFSET } from './Snackbar'

type SnackbarContextType = {
offset: number
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/hooks/useSnackbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useContext } from 'react'

import * as Toast from 'react-native-toast-notifications'

import {
DEFAULT_OFFSET,
modifyToastOptions,
Expand All @@ -15,7 +17,7 @@ export function useSnackbar() {
const context = useContext(SnackbarContext)

if (!context) {
throw new Error('useSnackbar must be used within an SnackbarProvider')
throw new Error('useSnackbar must be used within a SnackbarProvider')
}

const { offset, setOffset } = context
Expand Down

0 comments on commit 37b8920

Please sign in to comment.