Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(components): change button state styling to fix disappearing buttons #2877

Merged
merged 4 commits into from
Dec 11, 2024
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 apps/backoffice-v2/src/domains/notes/Notes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const Notes = ({
size={`sm`}
aria-disabled={isLoading}
className={
'mt-3 h-5 self-end p-4 text-sm font-medium aria-disabled:pointer-events-none aria-disabled:opacity-50'
'mt-3 h-5 self-end p-4 text-sm font-medium enabled:bg-primary enabled:hover:bg-primary/90 aria-disabled:pointer-events-none aria-disabled:opacity-50'
}
>
<Loader2 className={ctw('me-2 h-4 w-4 animate-spin', { hidden: !isLoading })} />
Expand Down
7 changes: 2 additions & 5 deletions apps/backoffice-v2/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,7 @@
}
}

a.bpComposerPoweredBy {
a.bpComposerPoweredBy,
div.bpHeaderExpandedContentDescriptionItemsPoweredBy {
Omri-Levy marked this conversation as resolved.
Show resolved Hide resolved
display: none !important;
}

button.bpModalDialogNewConversationButton {
background-color: var(--bpPrimary-500) !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ export const CallToActionLegacy: FunctionComponent<ICallToActionLegacyProps> = (
size="wide"
variant="warning"
disabled={disabled}
className={ctw({ 'flex gap-2': isReuploadResetable })}
className={ctw(
{ 'flex gap-2': isReuploadResetable },
'enabled:bg-warning enabled:hover:bg-warning/90',
)}
>
{value.text}
{isReuploadResetable && (
Expand Down Expand Up @@ -253,9 +256,11 @@ export const CallToActionLegacy: FunctionComponent<ICallToActionLegacyProps> = (
}
close={
<Button
className={ctw(`gap-x-2`, {
loading: isLoadingReuploadNeeded,
})}
className={ctw(
'gap-x-2',
{ loading: isLoadingReuploadNeeded },
'enabled:bg-primary enabled:hover:bg-primary/90',
)}
onClick={onReuploadNeeded({
workflowId: workflow?.id,
documentId: id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export const EditableDetails: FunctionComponent<IEditableDetails> = ({
{data?.some(({ isEditable }) => isEditable) && (
<Button
type="submit"
className={`ms-auto mt-3 aria-disabled:pointer-events-none aria-disabled:opacity-50`}
className={`ms-auto mt-3 enabled:bg-primary enabled:hover:bg-primary/90 aria-disabled:pointer-events-none aria-disabled:opacity-50`}
aria-disabled={isSaveDisabled}
>
Save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export const useDirectorsBlocks = ({
disabled={isApproveDisabled}
size={'wide'}
variant={'success'}
className={'enabled:bg-success enabled:hover:bg-success/90'}
>
Approve
</MotionButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export const useDocumentBlocks = ({
disabled={!canApprove}
size={'wide'}
variant={'success'}
className={'enabled:bg-success enabled:hover:bg-success/90'}
>
Approve
</MotionButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export const DefaultActions = () => {
size="md"
variant="warning"
disabled={isLoadingActions || !canRevision}
className={ctw({ loading: debouncedIsLoadingRejectCase }, 'whitespace-nowrap')}
className={ctw(
{ loading: debouncedIsLoadingRejectCase },
'whitespace-nowrap',
'enabled:bg-warning enabled:hover:bg-warning/90',
shanegrouber marked this conversation as resolved.
Show resolved Hide resolved
)}
>
Ask for all re-uploads {canRevision && `(${documentsToReviseCount})`}
</Button>
Expand All @@ -57,9 +61,11 @@ export const DefaultActions = () => {
<DialogFooter>
<DialogClose asChild>
<Button
className={ctw(`gap-x-2`, {
loading: debouncedIsLoadingRevisionCase,
})}
className={ctw(
'gap-x-2',
{ loading: debouncedIsLoadingRevisionCase },
'enabled:bg-primary enabled:hover:bg-primary/90',
)}
disabled={isLoadingActions || !canRevision}
onClick={onMutateRevisionCase}
>
Expand Down
19 changes: 5 additions & 14 deletions apps/backoffice-v2/src/pages/Root/Root.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Providers } from '../../common/components/templates/Providers/Providers
import { useCustomerQuery } from '@/domains/customer/hooks/queries/useCustomerQuery/useCustomerQuery';
import { FullScreenLoader } from '@/common/components/molecules/FullScreenLoader/FullScreenLoader';
import Chatbot from '@/domains/chat/chatbot-opengpt';
import { RenderChildrenInIFrame } from '@/common/components/organisms/RenderChildrenInIFrame/RenderChildrenInIFrame';
import { ctw } from '@/common/utils/ctw/ctw';
import { env } from '@/common/env/env';
import { Outlet } from 'react-router-dom';
import { ServerDownLayout } from './ServerDown.layout';
Expand Down Expand Up @@ -35,18 +33,11 @@ const ChatbotLayout: FunctionComponent = () => {
const botpressClientId = customer?.features?.chatbot?.clientId || env.VITE_BOTPRESS_CLIENT_ID;

return (
<RenderChildrenInIFrame
className={ctw('fixed bottom-right-0', {
'h-[700px] w-[400px]': isWebchatOpen,
'd-[80px]': !isWebchatOpen,
})}
>
<Chatbot
isWebchatOpen={isWebchatOpen}
toggleIsWebchatOpen={toggleIsWebchatOpen}
botpressClientId={botpressClientId}
/>
</RenderChildrenInIFrame>
<Chatbot
isWebchatOpen={isWebchatOpen}
toggleIsWebchatOpen={toggleIsWebchatOpen}
botpressClientId={botpressClientId}
/>
);
};

Expand Down
5 changes: 4 additions & 1 deletion apps/backoffice-v2/src/pages/SignIn/SignIn.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export const SignIn: FunctionComponent = () => {
)}
/>
<div className={`flex justify-end`}>
<Button type="submit" className={`ms-auto mt-3`}>
<Button
type="submit"
className={'ms-auto mt-3 enabled:bg-primary enabled:hover:bg-primary/90'}
>
Sign In
</Button>
</div>
Expand Down
Loading