Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
efstajas committed Nov 3, 2023
1 parent 546dcf8 commit f8b5abc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts">
import type { ProjectBadgeFragment } from '$lib/components/project-badge/__generated__/gql.generated';
import ProjectBadge from '$lib/components/project-badge/project-badge.svelte';
import type { Project } from '$lib/graphql/generated/graphql';
export let project: Project;
export let project: ProjectBadgeFragment;
</script>

<ProjectBadge linkToNewTab {project} />
<!-- TODO: Add claimable funds preview -->
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
} from '$lib/components/drip-list-members-editor/drip-list-members-editor.svelte';
import projectItem from '$lib/components/drip-list-members-editor/item-templates/project';
import mapFilterUndefined from '$lib/utils/map-filter-undefined';
import type { Project } from '$lib/graphql/generated/graphql';
const dispatch = createEventDispatcher<StepComponentEvents>();
Expand All @@ -30,7 +29,7 @@
async function fetchProjectDeps() {
try {
if ($context.dependencySplits.itemsPromise) {
const promises = ($context.dependencySplits.itemsPromise as Promise<Project>[]).map((p) =>
const promises = $context.dependencySplits.itemsPromise.map((p) =>
p.catch((error) => {
// eslint-disable-next-line no-console
console.log('💧 ~ Could not fetch project:', error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import assert from '$lib/utils/assert';
import { getRepoDriverClient } from '$lib/utils/get-drips-clients';
import query from '$lib/graphql/dripsQL';
import type { Project } from '$lib/graphql/generated/graphql';
import isClaimed from '$lib/utils/project/is-claimed';
import { gql } from 'graphql-request';
import type { ProjectQuery, ProjectQueryVariables } from './__generated__/gql.generated';
const dispatch = createEventDispatcher<StepComponentEvents>();
Expand Down Expand Up @@ -53,118 +53,13 @@
... on ClaimedProject {
account {
accountId
driver
}
color
description
emoji
owner {
accountId
address
driver
}
source {
forge
ownerName
repoName
url
}
verificationStatus
splits {
maintainers {
account {
accountId
address
}
driver
weight
}
dependencies {
... on AddressReceiver {
account {
accountId
address
}
driver
weight
}
... on ProjectReceiver {
driver
weight
project {
... on ClaimedProject {
account {
accountId
driver
}
color
description
emoji
owner {
accountId
address
driver
}
source {
forge
ownerName
repoName
url
}
verificationStatus
}
... on UnclaimedProject {
account {
accountId
driver
}
source {
forge
ownerName
repoName
url
}
verificationStatus
}
}
}
... on DripListReceiver {
driver
weight
dripList {
account {
accountId
}
owner {
accountId
address
driver
}
previousOwnerAddress
name
}
}
}
}
}
... on UnclaimedProject {
account {
accountId
driver
}
source {
forge
ownerName
repoName
url
}
verificationStatus
}
}
}
`;
const response = await query<{ project: Project | null }>(getProjectByIdQuery, {
const response = await query<ProjectQuery, ProjectQueryVariables>(getProjectByIdQuery, {
projectId: accountId,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import Button from '$lib/components/button/button.svelte';
import type { ProjectCustomizerFragment } from '$lib/components/project-customizer/__generated__/gql.generated';
import ProjectCustomizer from '$lib/components/project-customizer/project-customizer.svelte';
import type { ClaimedProject } from '$lib/graphql/generated/graphql';
import modal from '$lib/stores/modal';
import CheckCircle from 'radicle-design-system/icons/CheckCircle.svelte';
import type { Writable } from 'svelte/store';
export let project: Writable<ClaimedProject>;
export let project: Writable<ProjectCustomizerFragment>;
</script>

<div class="project-customizer-modal">
Expand Down
20 changes: 7 additions & 13 deletions src/routes/app/(flows)/claim-project/steps/review/review.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import Drip from '$lib/components/illustrations/drip.svelte';
import modal from '$lib/stores/modal';
import ProjectCustomizerModal from './components/project-customizer-modal.svelte';
import {
ProjectVerificationStatus,
type ClaimedProject,
Driver,
} from '$lib/graphql/generated/graphql';
import type { ProjectProfileHeader_ClaimedProject_Fragment } from '$lib/components/project-profile-header/__generated__/gql.generated';
const dispatch = createEventDispatcher<StepComponentEvents>();
Expand All @@ -35,19 +31,17 @@
$: project = $context.project ?? unreachable();
// For previewing what the project will look like after claiming
let fakeClaimedProject: ProjectProfileHeader_ClaimedProject_Fragment;
$: fakeClaimedProject = {
verificationStatus: ProjectVerificationStatus.Claimed,
account: { ...project.account },
__typename: 'ClaimedProject',
source: { ...project.source },
owner: {
driver: Driver.ADDRESS,
__typename: 'AddressDriverAccount',
address: $walletStore.address ?? unreachable(),
accountId: $walletStore.dripsAccountId ?? unreachable(),
},
color: $context.projectColor,
emoji: $context.projectEmoji,
splits: { maintainers: [], dependencies: [] },
} as ClaimedProject;
};
$: dependencyRepresentationalSplits = mapSplitsFromListEditorData(
$context.dependencySplits.items,
Expand Down Expand Up @@ -127,12 +121,12 @@
linkToNewTab={true}
list={[
{
type: 'split-group',
__typename: 'SplitGroup',
name: 'Dependencies',
list: dependencyRepresentationalSplits,
},
{
type: 'split-group',
__typename: 'SplitGroup',
name: 'Maintainers',
list: maintainerRepresentationalSplits,
},
Expand Down

0 comments on commit f8b5abc

Please sign in to comment.