-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add drip list description to funder flow (untested submit) * feat: description on drip-list-card and edit-drip-list * feat: new text-expandable component for drip-list-description * fix: description gets added in tx * test: add desc to drip-list tests * chore: package-lock rewrite from tailwindcss edit * fix: missing description param * style: rmv hover bg on text-expandable text * fix: handle dripList versioning/typing better
- Loading branch information
Showing
32 changed files
with
777 additions
and
327 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/lib/components/drip-list-editor/drip-list-editor.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<script lang="ts" context="module"> | ||
export interface DripListConfig { | ||
items: Items; | ||
percentages: Percentages; | ||
title: string; | ||
description: string | undefined; | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import type { | ||
Items, | ||
Percentages, | ||
} from '$lib/components/drip-list-members-editor/drip-list-members-editor.svelte'; | ||
import ListEditor from '$lib/components/drip-list-members-editor/drip-list-members-editor.svelte'; | ||
import FormField from '../form-field/form-field.svelte'; | ||
import TextInput from '../text-input/text-input.svelte'; | ||
import TextArea from '../text-area/text-area.svelte'; | ||
import type { TextInputValidationState } from 'radicle-design-system/TextInput'; | ||
export let dripList: DripListConfig = { | ||
title: 'My Drip List', | ||
percentages: {}, | ||
items: {}, | ||
description: undefined, | ||
}; | ||
export let showListFirst = false; | ||
export let projectUrlToAdd: string | undefined = undefined; | ||
// validation | ||
let listValid = false; | ||
$: titleValid = dripList.title.length > 0; | ||
$: descriptionValid = textAreaValidationState.type === 'valid'; | ||
export let isValid = false; | ||
$: isValid = listValid && titleValid && descriptionValid; | ||
let textAreaValidationState: TextInputValidationState; | ||
$: textAreaValidationState = !dripList.description | ||
? { type: 'valid' } | ||
: dripList.description.length >= 1000 | ||
? { type: 'invalid', message: `Cannot exceed ${Number(1000).toLocaleString()} characters.` } | ||
: /<[^>]+>/gi.test(dripList.description) | ||
? { type: 'invalid', message: 'HTML currently not allowed.' } | ||
: { type: 'valid' }; | ||
</script> | ||
|
||
<section class="flex flex-col gap-8"> | ||
<FormField title="Title*"> | ||
<TextInput bind:value={dripList.title} /> | ||
</FormField> | ||
|
||
<FormField title="Description"> | ||
<TextArea | ||
bind:value={dripList.description} | ||
resizable={true} | ||
validationState={textAreaValidationState} | ||
/> | ||
</FormField> | ||
|
||
<div class:order-first={showListFirst}> | ||
<FormField title="Members*"> | ||
<!-- TODO: This crashes when entering some non-valid github url --> | ||
<ListEditor | ||
bind:percentages={dripList.percentages} | ||
bind:items={dripList.items} | ||
bind:valid={listValid} | ||
addOnMount={projectUrlToAdd} | ||
/> | ||
</FormField> | ||
</div> | ||
</section> |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/list-editor/item-templates/drip-list.ts → ...embers-editor/item-templates/drip-list.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...list-editor/item-templates/eth-address.ts → ...bers-editor/item-templates/eth-address.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nts/list-editor/item-templates/project.ts → ...-members-editor/item-templates/project.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.