Skip to content

Commit

Permalink
Sticking with the Tremor switch as the NextUI switch has the same per…
Browse files Browse the repository at this point in the history
…formance bug as Daisy.
  • Loading branch information
buchananwill committed Mar 29, 2024
1 parent 49dcf4e commit 64c5a97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/generic/components/tooltips/tool-tips-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { Switch, Text } from '@tremor/react';
import { Switch } from '@tremor/react';
import React from 'react';
import { useTooltipsContext } from './tooltips-context-provider';

Expand All @@ -8,13 +8,13 @@ const ToolTipsToggle = () => {

return (
<label className="flex items-center">
<Text className={'text-gray-200'}>Tooltips:</Text>
<p className={'text-gray-400'}>Tooltips:</p>
<Switch
// type="checkbox"
name="tool-tips"
// className="toggle toggle-xs ml-1 toggle-success"
checked={showTooltips}
onChange={() => setShowTooltips(!showTooltips)}
onChange={() => setShowTooltips((prev) => !prev)}
></Switch>
</label>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export default function TooltipsContextProvider({

const contextValue: TooltipsState = {
showTooltips: showTooltips,
setShowTooltips: (value: boolean) => {
setShowTooltips(value);
}
setShowTooltips: setShowTooltips
};

return (
Expand Down
4 changes: 2 additions & 2 deletions app/generic/components/tooltips/tooltips-context.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createContext } from 'react';
import { createContext, Dispatch, SetStateAction } from 'react';

export interface TooltipsState {
showTooltips: boolean;
setShowTooltips: (value: boolean) => void;
setShowTooltips: Dispatch<SetStateAction<boolean>>;
}

export default createContext<TooltipsState>({
Expand Down

0 comments on commit 64c5a97

Please sign in to comment.