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

fix(CustomField): add a way to have icon in custom fields #1780

Merged
merged 3 commits into from
May 20, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/azurill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/bronzor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/chikorita.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/ditto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/gengar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/glalie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/nosepass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/pikachu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/rhyhorn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const Profiles = () => {
) : (
<p>{item.username}</p>
)}
<p className="text-sm">{item.network}</p>
{!item.icon && <p className="text-sm">{item.network}</p>}
</div>
)}
</Section>
Expand Down
5 changes: 4 additions & 1 deletion apps/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@
<!-- Styles -->
<link rel="stylesheet" href="/src/styles/main.css" />
</head>
<body class="bg-background text-foreground text-sm antialiased print:bg-white print:m-0">
<body class="text-sm antialiased bg-background text-foreground print:bg-white print:m-0">
<div id="root"></div>

<!-- Scripts -->
<script type="module" src="/src/main.tsx"></script>

<!-- Phosphor Icons -->
<script src="https://unpkg.com/@phosphor-icons/web"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { t } from "@lingui/macro";
import { createId } from "@paralleldrive/cuid2";
import { DotsSixVertical, Plus, X } from "@phosphor-icons/react";
import { DotsSixVertical, Envelope, Plus, X } from "@phosphor-icons/react";
import { CustomField as ICustomField } from "@reactive-resume/schema";
import { Button, Input } from "@reactive-resume/ui";
import {
Popover,
PopoverContent,
PopoverTrigger,
Tooltip,
Button,
Input,
} from "@reactive-resume/ui";
import { cn } from "@reactive-resume/utils";
import { AnimatePresence, Reorder, useDragControls } from "framer-motion";

Expand Down Expand Up @@ -42,6 +49,23 @@ export const CustomField = ({ field, onChange, onRemove }: CustomFieldProps) =>
<DotsSixVertical />
</Button>

<Popover>
<Tooltip content={t`Icon`}>
<PopoverTrigger asChild>
<Button size="icon" variant="ghost">
{field.icon ? <i className={`ph ph-${field.icon}`}></i> : <Envelope />}
</Button>
</PopoverTrigger>
</Tooltip>
<PopoverContent className="p-1.5">
<Input
value={field.icon}
placeholder={t`Enter Phosphor Icon`}
onChange={(event) => onChange({ ...field, icon: event.target.value })}
/>
</PopoverContent>
</Popover>

<Input
placeholder={t`Name`}
value={field.name}
Expand Down