Skip to content

Commit

Permalink
Feat: Remove "Project" from ProjectCard (#3343)
Browse files Browse the repository at this point in the history
# Motivation

Remove the word "Project" from the ProjectCard. Leave instead only the
SNS name.

# Changes

* Remove the "Project" word from ProjectCard.svelte.
* Remove i18n keys.

# Tests

* Adapt test.

# Todos

- [x] Add entry to changelog (if necessary).
  • Loading branch information
lmuntaner authored Sep 21, 2023
1 parent 0e3aa5a commit 27f62b8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-Nns-Dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The NNS Dapp is released through proposals in the Network Nervous System. Theref
* Use consistent positioning for the copy icon in the Hash component.
* Allow setting a dissolve delay that's shorter than what's required for voting power.
* Improve contrast of token selector's logo in light theme.
* Remove the "Project" leading word in the SNS Project card.

#### Deprecated
#### Removed
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/lib/components/launchpad/ProjectCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
metadata: { logo, name, description },
} = summary);
let title: string;
$: title = `${$i18n.sns_project.project} ${name}`;
let commitmentE8s: bigint | undefined;
$: commitmentE8s = getCommitmentE8s(swapCommitment);
Expand All @@ -45,7 +42,7 @@
>
<div class="title" slot="start">
<Logo src={logo} alt={$i18n.sns_launchpad.project_logo} size="big" />
<h3 data-tid="project-name">{title}</h3>
<h3 data-tid="project-name">{name}</h3>
</div>

<p class="value description">{description}</p>
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,6 @@
"project_logo": "project logo",
"no_proposals": "There are no decentralisation swap proposals open at the moment."
},
"sns_project": {
"project": "Project"
},
"sns_project_detail": {
"token_name": "Token Name",
"token_symbol": "Token Symbol",
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/lib/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,6 @@ interface I18nSns_launchpad {
no_proposals: string;
}

interface I18nSns_project {
project: string;
}

interface I18nSns_project_detail {
token_name: string;
token_symbol: string;
Expand Down Expand Up @@ -1279,7 +1275,6 @@ interface I18n {
proposal_detail__ineligible: I18nProposal_detail__ineligible;
neuron_detail: I18nNeuron_detail;
sns_launchpad: I18nSns_launchpad;
sns_project: I18nSns_project;
sns_project_detail: I18nSns_project_detail;
sns_sale: I18nSns_sale;
sns_neuron_detail: I18nSns_neuron_detail;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/tests/e2e/sns-participation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test("Test SNS participation", async ({ page, context }) => {
const projectDetail = appPo.getProjectDetailPo();
await projectDetail.waitForContentLoaded();
const projectName = await projectDetail.getProjectName();
expect(`Project ${projectName}`).toBe(snsProjectName);
expect(projectName).toBe(snsProjectName);
expect(await projectDetail.getTokenSymbol()).not.toBe("");
expect(await projectDetail.getStatus()).toBe("Accepting Participation");

Expand Down
14 changes: 7 additions & 7 deletions frontend/src/tests/lib/components/launchpad/ProjectCard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ describe("ProjectCard", () => {
);
});

it("should render a title", () => {
const { getByText } = render(ProjectCard, {
it("should render a title", async () => {
const { container } = render(ProjectCard, {
props: {
project: mockSnsFullProject,
},
});

expect(
getByText(
`${en.sns_project.project} ${mockSnsFullProject.summary.metadata.name}`
)
).toBeInTheDocument();
const po = ProjectCardPo.under(new JestPageObjectElement(container));

expect(await po.getProjectName()).toBe(
mockSnsFullProject.summary.metadata.name
);
});

it("should render a description", () => {
Expand Down

0 comments on commit 27f62b8

Please sign in to comment.