Skip to content

Commit

Permalink
refactor: rename <FeedbackBox> to <WarningFeedback>
Browse files Browse the repository at this point in the history
  • Loading branch information
flsilva committed Nov 26, 2023
1 parent 041f685 commit f63d2a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/modules/app/projects/ProjectPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound } from 'next/navigation';
import { getProjectById } from './ProjectsRepository';
import { ProjectMutationDropdown } from './ProjectMutationDropdown';
import { FeedbackBox } from '@/modules/shared/box/FeedbackBox';
import { WarningFeedback } from '@/modules/shared/feedback/WarningFeedback';
import { ErrorList } from '@/modules/shared/errors/ErrorList';

export interface ProjectPageHeaderProps {
Expand All @@ -24,9 +24,9 @@ export const ProjectPageHeader = async ({ id }: ProjectPageHeaderProps) => {
<p className="block whitespace-pre-line text-sm mb-8">{project.description}</p>
)}
{project.archivedAt && (
<FeedbackBox className="mb-8">
<WarningFeedback className="mb-8">
<p className="block">This project is archived.</p>
</FeedbackBox>
</WarningFeedback>
)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { twMerge } from 'tailwind-merge';
import { ChildrenProps } from '@/modules/shared/ChildrenProps';
import { ClassNamePropsOptional } from '@/modules/shared/ClassNameProps';
import { FeedbackIcon } from '@/modules/shared/icons/FeedbackIcon';
import { WarningIcon } from '@/modules/shared/icons/WarningIcon';

interface FeedbackBoxProps extends ChildrenProps, ClassNamePropsOptional {}
interface WarningFeedbackProps extends ChildrenProps, ClassNamePropsOptional {}

export const FeedbackBox = ({ children, className }: FeedbackBoxProps) => (
export const WarningFeedback = ({ children, className }: WarningFeedbackProps) => (
<div
className={twMerge(
'flex flex-col bg-orange-50 p-6 rounded-2xl border border-[rgb(229, 231, 235)]',
className,
)}
>
<h3>
<FeedbackIcon className="fill-orange-700" />
<WarningIcon className="fill-orange-700" />
</h3>
<div className="flex mt-6 text-sm whitespace-pre-line">{children}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const FeedbackIcon = (props: React.SVGProps<SVGSVGElement>) => (
export const WarningIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 -960 960 960"
Expand Down

0 comments on commit f63d2a6

Please sign in to comment.