Skip to content

Commit

Permalink
Merge branch 'dev' into codemirror
Browse files Browse the repository at this point in the history
  • Loading branch information
tnfAngel committed May 29, 2024
2 parents 323947e + d211400 commit 38b3d30
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"files": {
"ignore": ["./.next/", "**/node_modules/", "./dist/"],
"ignore": ["./.next/", "**/node_modules/", "./dist/", "./out/"],
"ignoreUnknown": true
},
"formatter": {
Expand Down
53 changes: 25 additions & 28 deletions src/components/general/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,35 @@ import LogoIcon from '@/components/LogoIcon';
import useThemeValues from '@/hooks/useThemeValues';
import type { ActionButtonProps, ControlsProps } from '@/types/Components.ts';
import { Box, Flex, IconButton, Spacer, Tooltip, useToast } from '@chakra-ui/react';
import { type ForwardedRef, forwardRef, useState } from 'react';
import { useState } from 'react';
import { MdEdit, MdSave, MdSettings, MdSubject } from 'react-icons/md';
import SettingsPopover from '../modals/SettingsPopover';

const ActionButton = forwardRef(
({ icon, label, onClick, isDisabled, isLoading }: ActionButtonProps, ref: ForwardedRef<any>) => {
const { getThemeValue } = useThemeValues();
const ActionButton = ({ icon, label, onClick, isDisabled, isLoading }: ActionButtonProps) => {
const { getThemeValue } = useThemeValues();

return (
<Tooltip
label={!isDisabled ? label : `${label} (Disabled)`}
bg={getThemeValue('tooltip')}
color={getThemeValue('text')}
placement='top'
m='5px'
gutter={5}
hasArrow
>
<IconButton
ref={ref}
size='sm'
aria-label={label}
color={getThemeValue('primary')}
icon={icon}
onClick={onClick}
isDisabled={isDisabled ?? false}
isLoading={isLoading ?? false}
/>
</Tooltip>
);
}
);
return (
<Tooltip
label={!isDisabled ? label : `${label} (Disabled)`}
bg={getThemeValue('tooltip')}
color={getThemeValue('text')}
placement='top'
m='5px'
gutter={5}
hasArrow
>
<IconButton
size='sm'
aria-label={label}
color={getThemeValue('primary')}
icon={icon}
onClick={onClick}
isDisabled={isDisabled ?? false}
isLoading={isLoading ?? false}
/>
</Tooltip>
);
};

const Controls = ({ documentId, value, isEditing, setIsEditing, enableEdit }: ControlsProps) => {
const { getThemeValue } = useThemeValues();
Expand Down

0 comments on commit 38b3d30

Please sign in to comment.