Skip to content

Commit 9697719

Browse files
author
Crisgarner
committed
chore: fixed dark mode and added short bio
1 parent c3de9da commit 9697719

File tree

11 files changed

+30
-27
lines changed

11 files changed

+30
-27
lines changed

packages/interface/src/components/InfiniteLoading.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const InfiniteLoading = <T,>({
4343

4444
return (
4545
<div>
46-
{!isLoading && !items.length ? <EmptyState title="No results found" /> : null}
46+
{!isLoading && !items.length ? <EmptyState title="No proposals yet! Be the first to create one." /> : null}
4747

4848
<div className={`mb-16 grid ${columnMap[columns]} gap-4`}>
4949
{items.map((item) => renderItem(item, { isLoading }))}

packages/interface/src/components/VotingInfo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const VotingInfo = ({ pollId }: IVotingInfoProps): JSX.Element => {
3434
{!isLoading && timeLeft[3] < 0 && <p>Voting has ended</p>}
3535

3636
{!isLoading && timeLeft[3] > 0 && (
37-
<div className="flex gap-2">
37+
<div className="flex gap-2 dark:text-white">
3838
<TimeSlot num={timeLeft[0]} unit="Days" />
3939

4040
<TimeSlot num={timeLeft[1]} unit="Hours" />

packages/interface/src/features/applications/components/ApplicationButtons.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const ApplicationButtons = ({
4141

4242
const [
4343
name,
44+
shortBio,
4445
bio,
4546
payoutAddress,
4647
websiteUrl,
@@ -55,6 +56,7 @@ export const ApplicationButtons = ({
5556
() =>
5657
form.watch([
5758
"name",
59+
"shortBio",
5860
"bio",
5961
"payoutAddress",
6062
"websiteUrl",
@@ -79,6 +81,7 @@ export const ApplicationButtons = ({
7981
return (
8082
bannerImageUrl !== undefined &&
8183
profileImageUrl !== undefined &&
84+
shortBio.length > 0 &&
8285
bio.length > 0 &&
8386
name.length > 0 &&
8487
payoutAddress.length > 0 &&

packages/interface/src/features/applications/components/ApplicationForm.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ export const ApplicationForm = ({ pollId }: IApplicationFormProps): JSX.Element
9191
<Input placeholder="Type your project name" />
9292
</FormControl>
9393

94+
<FormControl required label="Short Description" name="shortBio">
95+
<Textarea placeholder="Short description. Maximum 140 characters." rows={4} />
96+
</FormControl>
97+
9498
<FormControl required label="Description" name="bio">
9599
<Textarea placeholder="Type project description" rows={4} />
96100
</FormControl>
@@ -194,7 +198,7 @@ export const ApplicationForm = ({ pollId }: IApplicationFormProps): JSX.Element
194198
<FieldArray
195199
description="From what sources have you received funding?"
196200
name="fundingSources"
197-
renderField={(field, i) => (
201+
renderField={(_field, i) => (
198202
<div className="mb-4 flex flex-wrap gap-2">
199203
<FormControl required className="min-w-96" name={`fundingSources.${i}.description`}>
200204
<Input placeholder="Type the name of your funding source" />

packages/interface/src/features/applications/components/ApplicationItem.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Checkbox } from "~/components/ui/Form";
88
import { Skeleton } from "~/components/ui/Skeleton";
99
import { ProjectAvatar } from "~/features/projects/components/ProjectAvatar";
1010
import { useMetadata } from "~/hooks/useMetadata";
11-
import { removeMarkdown } from "~/utils/removeMarkdown";
1211
import { formatDate } from "~/utils/time";
1312

1413
import type { TApplicationsToApprove, Application } from "../types";
@@ -34,10 +33,11 @@ export const ApplicationItem = ({
3433
const form = useFormContext<TApplicationsToApprove>();
3534

3635
const { profileImageUrl } = metadata.data ?? {};
37-
const bio =
38-
metadata.data?.bio && metadata.data.bio.length > 140
39-
? `${metadata.data.bio.substring(0, 140)}...`
40-
: metadata.data?.bio;
36+
let shortBio = metadata.data?.shortBio;
37+
const bio = metadata.data?.bio;
38+
if (!shortBio && bio) {
39+
shortBio = bio.substring(0, 140);
40+
}
4141

4242
useEffect(() => {
4343
if (isApproved) {
@@ -67,7 +67,7 @@ export const ApplicationItem = ({
6767
</Skeleton>
6868

6969
<div className="text-sm text-gray-400">
70-
<div>{removeMarkdown(bio || "")}</div>
70+
<div>{shortBio}</div>
7171
</div>
7272
</div>
7373
</div>

packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export const ReviewApplicationDetails = (): JSX.Element => {
7070

7171
<ValueField required body={address} title="Created By" />
7272

73+
<ValueField required body={application.shortBio} title="Project description" />
74+
7375
<ValueField required body={<Markdown>{application.bio}</Markdown>} title="Project description" />
7476

7577
<div className="grid grid-flow-row gap-4 sm:grid-cols-2">
@@ -178,6 +180,7 @@ export const ReviewApplicationDetails = (): JSX.Element => {
178180
profileImageUrl: application.profileImageUrl,
179181
name: application.name,
180182
bio: application.bio,
183+
shortBio: application.shortBio,
181184
impactCategory: application.impactCategory,
182185
}}
183186
/>

packages/interface/src/features/applications/types/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const fundingSourceTypes = {
2424

2525
export const ApplicationSchema = z.object({
2626
name: z.string().min(3),
27+
shortBio: z.string().max(140),
2728
bio: z.string().min(3),
2829
creator: z.string().optional(),
2930
profileImageUrl: z.string().optional(),

packages/interface/src/features/home/components/FaqList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Heading } from "~/components/ui/Heading";
33
import { FAQItem } from "./FaqItem";
44

55
export const FAQList = (): JSX.Element => (
6-
<div className="mt-14 flex flex-col items-center justify-center sm:mt-28 dark:text-white" id="FAQ">
6+
<div className="dark:bg-lightBlack flex flex-col items-center justify-center py-14 sm:pt-28 dark:text-white" id="FAQ">
77
<Heading size="6xl">FAQ</Heading>
88

99
<FAQItem

packages/interface/src/features/projects/components/ProjectItem.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Heading } from "~/components/ui/Heading";
66
import { Skeleton } from "~/components/ui/Skeleton";
77
import { config } from "~/config";
88
import { formatNumber } from "~/utils/formatNumber";
9-
import { removeMarkdown } from "~/utils/removeMarkdown";
109
import { useRoundState } from "~/utils/state";
1110
import { ERoundState } from "~/utils/types";
1211

@@ -39,7 +38,11 @@ export const ProjectItem = ({
3938
const bannerImageUrl = recipient.bannerImageUrl ? recipient.bannerImageUrl : metadata.data?.bannerImageUrl;
4039
const profileImageUrl = recipient.profileImageUrl ? recipient.profileImageUrl : metadata.data?.profileImageUrl;
4140
const name = recipient.name ? recipient.name : metadata.data?.name;
41+
let shortBio = recipient.shortBio ? recipient.shortBio : metadata.data?.shortBio;
4242
const bio = recipient.bio ? recipient.bio : metadata.data?.bio;
43+
if (!shortBio && bio) {
44+
shortBio = bio.substring(0, 140);
45+
}
4346
const impactCategory = recipient.impactCategory ? recipient.impactCategory : metadata.data?.impactCategory;
4447

4548
return (
@@ -61,7 +64,7 @@ export const ProjectItem = ({
6164

6265
<div className="mb-2 line-clamp-2 h-10 text-sm text-gray-400">
6366
<Skeleton className="w-full" isLoading={isLoading}>
64-
{removeMarkdown(bio || "")}
67+
{shortBio}
6568
</Skeleton>
6669
</div>
6770

packages/interface/src/utils/removeMarkdown.ts

-15
This file was deleted.

packages/interface/src/utils/types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ export interface IRecipient {
263263
* Bio of the recipient, used only for preview of card
264264
*/
265265
bio?: string;
266+
/**
267+
* Short Bio of the recipient, used only for preview of card
268+
*/
269+
shortBio?: string;
266270
/**
267271
* Impact categories of the recipient, used only for preview of card
268272
*/

0 commit comments

Comments
 (0)