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

Design nudges #1055

Merged
merged 2 commits into from
Dec 18, 2023
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
15 changes: 5 additions & 10 deletions src/ui/components/AvailabilityMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CheckIcon, XIcon } from "lucide-react";
import { XIcon } from "lucide-react";

type Props = {
isAvailable: boolean;
Expand All @@ -7,18 +7,13 @@ type Props = {
const pClasses = "ml-1 text-sm font-semibold text-neutral-500";

export const AvailabilityMessage = ({ isAvailable }: Props) => {
if (isAvailable) {
if (!isAvailable) {
return (
<div className="mt-6 flex items-center">
<CheckIcon className="h-5 w-5 flex-shrink-0 text-green-500" aria-hidden="true" />
<p className={pClasses}>In stock</p>
<XIcon className="h-5 w-5 flex-shrink-0 text-neutral-50" aria-hidden="true" />
<p className={pClasses}>Out of stock</p>
</div>
);
}
return (
<div className="mt-6 flex items-center">
<XIcon className="h-5 w-5 flex-shrink-0 text-red-500" aria-hidden="true" />
<p className={pClasses}>Out of stock</p>
</div>
);
return <></>;
};
2 changes: 1 addition & 1 deletion src/ui/components/VariantSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function VariantSelector({
isCurrentVariant
? "border-transparent bg-neutral-900 text-white hover:bg-neutral-800"
: "border-neutral-200 bg-white text-neutral-900 hover:bg-neutral-100",
"relative flex min-w-[8ch] items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded border p-3 text-center text-sm font-semibold focus-within:outline focus-within:outline-2 aria-disabled:cursor-not-allowed aria-disabled:bg-neutral-100 aria-disabled:text-neutral-800 aria-disabled:opacity-50",
"relative flex min-w-[5ch] items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded border p-3 text-center text-sm font-semibold focus-within:outline focus-within:outline-2 aria-disabled:cursor-not-allowed aria-disabled:bg-neutral-100 aria-disabled:text-neutral-800 aria-disabled:opacity-50",
isDisabled && "pointer-events-none",
)}
role="radio"
Expand Down
Loading