Skip to content

Commit 991987b

Browse files
authored
[DDW-754] Update Catalyst links (#2721)
* [DDW-754] Use updated react-polymorph * [DDW-754] Update yarn lock * [DDW-754] Add VotingFooterLinks component * [DDW-754] Update theming of voting footer links * [DDW-754] Translate voting footer links * [DDW-754] Alphabetize CSS properties * [DDW-754] Update catalyst links and translations * [DDW-754] Adjust footer link font size * [DDW-754] Move margin to button component in voting info * [DDW-754] Update catalyst footer link divider * [DDW-754] Update voting registration page to always display catalyst footer links * [DDW-754] Update return condition for inner content of voting registration page * [DDW-754] Updated CHANGELOG * [DDW-754] Add footerl inks to voting story * [DDW-754] Update delegation center padding if no scroll present * [DDW-754] Vertically align no wallet component in delegation and voting pages * [DDW-754] Vertically align no wallet component in delegation and voting pages * [DDW-754] Adjust stakepool link font-size in popover * [DDW-754] Update react-polymorph
1 parent 00f0124 commit 991987b

24 files changed

+252
-52
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Features
66

7+
- Added Catalyst footer links ([PR 2721](https://github.com/input-output-hk/daedalus/pull/2721))
78
- Fixed the Delegation popover timeout ([PR 2722](https://github.com/input-output-hk/daedalus/pull/2722))
89
- Removed "Alonzo tada" icon and "Alonzo countdown" screen ([PR 2708](https://github.com/input-output-hk/daedalus/pull/2708))
910

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
"react-intl": "2.7.2",
229229
"react-lottie": "1.2.3",
230230
"react-markdown": "4.3.1",
231-
"react-polymorph": "1.0.0-next.1",
231+
"react-polymorph": "1.0.1",
232232
"react-router": "5.2.0",
233233
"react-router-dom": "5.2.0",
234234
"react-svg-inline": "2.1.1",

source/renderer/app/components/staking/delegation-center/DelegationCenterNoWallets.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
line-height: 1.38;
1010
margin: 0 auto;
1111
max-width: 680px;
12-
padding: 0 40px;
12+
padding: 0 40px 0 60px;
1313
text-align: center;
1414
width: 100%;
1515

source/renderer/app/components/staking/widgets/TooltipPool.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ $tooltip-width: 280px;
1414
z-index: 1000;
1515

1616
:global {
17+
span.SimpleLink_root {
18+
font-size: var(--rp-button-font-size);
19+
}
1720
button.SimpleButton_root {
1821
background-color: var(
1922
--theme-staking-stake-pool-tooltip-delegate-button-background-color
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// @flow
2+
import React from 'react';
3+
import { Link } from 'react-polymorph/lib/components/Link';
4+
import { observer } from 'mobx-react';
5+
import { defineMessages, intlShape, injectIntl } from 'react-intl';
6+
7+
import styles from './VotingFooterLinks.scss';
8+
9+
type FooterLink = {
10+
url: string,
11+
label: string,
12+
};
13+
14+
type Props = {
15+
onClickExternalLink: Function,
16+
intl: intlShape.isRequired,
17+
};
18+
19+
const messages = defineMessages({
20+
newsletter: {
21+
id: 'voting.catalystFooterLinks.newsletter',
22+
defaultMessage: 'Newsletter',
23+
description: '"Newsletter" link for Project Catalyst footer',
24+
},
25+
announcements: {
26+
id: 'voting.catalystFooterLinks.announcements',
27+
defaultMessage: 'Announcements Channel',
28+
description: '"Announcements Channel" link for Project Catalyst footer',
29+
},
30+
community: {
31+
id: 'voting.catalystFooterLinks.community',
32+
defaultMessage: 'Community Chat',
33+
description: '"Community Chat" link for Project Catalyst footer',
34+
},
35+
projects: {
36+
id: 'voting.catalystFooterLinks.projects',
37+
defaultMessage: 'Projects',
38+
description: '"Projects" link for Project Catalyst footer',
39+
},
40+
});
41+
42+
export const VotingFooterLinks = injectIntl(
43+
observer(({ onClickExternalLink, intl }: Props) => {
44+
const links: FooterLink[] = [
45+
{
46+
url: 'https://bit.ly/3dSZJvx',
47+
label: intl.formatMessage(messages.newsletter),
48+
},
49+
{
50+
url: 'https://t.me/cardanocatalyst',
51+
label: intl.formatMessage(messages.announcements),
52+
},
53+
{
54+
url: 'https://t.me/ProjectCatalystChat',
55+
label: intl.formatMessage(messages.community),
56+
},
57+
{
58+
url: 'https://cardano.ideascale.com/',
59+
label: intl.formatMessage(messages.projects),
60+
},
61+
];
62+
63+
return (
64+
<ul className={styles.component}>
65+
{links.map((link) => (
66+
<li key={link.url}>
67+
<Link
68+
className={styles.link}
69+
label={link.label}
70+
onClick={(event) => onClickExternalLink(link.url, event)}
71+
/>
72+
</li>
73+
))}
74+
</ul>
75+
);
76+
})
77+
);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.component {
2+
align-items: flex-end;
3+
display: flex;
4+
font-size: 14px;
5+
justify-content: center;
6+
padding: 0 0 20px 0;
7+
8+
li {
9+
.link {
10+
font-size: 14px;
11+
line-height: 1.43;
12+
opacity: 0.7;
13+
}
14+
.link:hover {
15+
opacity: 1;
16+
}
17+
}
18+
19+
li:not(:first-child)::before {
20+
background-color: var(--theme-voting-footer-separator-color);
21+
content: '';
22+
display: inline-flex;
23+
height: 11px;
24+
margin: 0 20px;
25+
width: 1px;
26+
}
27+
}

source/renderer/app/components/voting/VotingInfo.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
@import './votingConfig';
22

33
.component {
4+
flex: 1;
45
padding: 20px;
56
text-align: center;
67

78
:global {
89
button.SimpleButton_root {
10+
margin-top: 30px;
911
width: 415px;
1012
}
1113
}
@@ -18,7 +20,6 @@
1820
.bottomContent {
1921
display: flex;
2022
justify-content: space-between;
21-
margin-bottom: 30px;
2223

2324
.leftContent {
2425
text-align: left;
@@ -35,7 +36,7 @@
3536
display: block;
3637
font-family: var(--font-light);
3738
line-height: 1.38;
38-
margin: 0 20px 20px 0;
39+
margin: 0;
3940

4041
b {
4142
font-family: var(--font-medium);

source/renderer/app/components/voting/VotingNoWallets.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
height: 100%;
88
justify-content: center;
99
line-height: 1.38;
10-
margin: 0 auto;
10+
margin: 50px auto -40px auto;
1111
max-width: 680px;
1212
padding: 0 40px;
1313
text-align: center;

source/renderer/app/components/voting/VotingUnavailable.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
flex: 1;
88
flex-direction: column;
99
justify-content: center;
10+
margin-bottom: -40px;
1011
padding: 20px;
1112
text-align: center;
1213

source/renderer/app/containers/voting/VotingRegistrationPage.js

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import VotingRegistrationDialog from '../../components/voting/voting-registratio
1414
import { ROUTES } from '../../routes-config';
1515
import type { InjectedProps } from '../../types/injectedPropsType';
1616
import VotingRegistrationDialogContainer from './dialogs/VotingRegistrationDialogContainer';
17+
import { VotingFooterLinks } from '../../components/voting/VotingFooterLinks';
1718

1819
type Props = InjectedProps;
1920

@@ -26,61 +27,67 @@ export default class VotingRegistrationPage extends Component<Props> {
2627
this.props.actions.router.goToRoute.trigger({ route: ROUTES.WALLETS.ADD });
2728
};
2829

29-
render() {
30-
const { actions, stores } = this.props;
31-
const { app, networkStatus, uiDialogs, wallets, voting, profile } = stores;
32-
const { openExternalLink } = app;
30+
getInnerContent = (isVotingRegistrationDialogOpen: boolean) => {
31+
const { app, networkStatus, wallets, voting, profile } = this.props.stores;
3332
const { isSynced, syncPercentage } = networkStatus;
3433
const { isRegistrationEnded } = voting;
35-
const { currentTimeFormat, currentDateFormat, currentLocale } = profile;
36-
37-
const isVotingRegistrationDialogOpen = uiDialogs.isOpen(
38-
VotingRegistrationDialog
39-
);
34+
const { openExternalLink } = app;
4035

4136
if (
4237
!IS_VOTING_REGISTRATION_AVAILABLE ||
4338
(!isSynced && !isVotingRegistrationDialogOpen)
4439
) {
4540
return (
46-
<Layout>
47-
<VerticalFlexContainer>
48-
<VotingUnavailable
49-
syncPercentage={syncPercentage}
50-
isVotingRegistrationAvailable={IS_VOTING_REGISTRATION_AVAILABLE}
51-
onExternalLinkClick={openExternalLink}
52-
/>
53-
</VerticalFlexContainer>
54-
</Layout>
41+
<VotingUnavailable
42+
syncPercentage={syncPercentage}
43+
isVotingRegistrationAvailable={IS_VOTING_REGISTRATION_AVAILABLE}
44+
onExternalLinkClick={openExternalLink}
45+
/>
5546
);
5647
}
5748

5849
if (!wallets.allWallets.length) {
5950
return (
60-
<Layout>
61-
<VotingNoWallets
62-
onGoToCreateWalletClick={this.handleGoToCreateWalletClick}
63-
minVotingFunds={VOTING_REGISTRATION_MIN_WALLET_FUNDS}
64-
/>
65-
</Layout>
51+
<VotingNoWallets
52+
onGoToCreateWalletClick={this.handleGoToCreateWalletClick}
53+
minVotingFunds={VOTING_REGISTRATION_MIN_WALLET_FUNDS}
54+
/>
6655
);
6756
}
6857

58+
const { currentTimeFormat, currentDateFormat, currentLocale } = profile;
59+
return (
60+
<VotingInfo
61+
currentLocale={currentLocale}
62+
currentDateFormat={currentDateFormat}
63+
currentTimeFormat={currentTimeFormat}
64+
isRegistrationEnded={isRegistrationEnded}
65+
onRegisterToVoteClick={() =>
66+
this.props.actions.dialogs.open.trigger({
67+
dialog: VotingRegistrationDialog,
68+
})
69+
}
70+
onExternalLinkClick={openExternalLink}
71+
/>
72+
);
73+
};
74+
75+
render() {
76+
const { stores } = this.props;
77+
const { app, uiDialogs } = stores;
78+
const { openExternalLink } = app;
79+
80+
const isVotingRegistrationDialogOpen = uiDialogs.isOpen(
81+
VotingRegistrationDialog
82+
);
83+
84+
const innerContent = this.getInnerContent(isVotingRegistrationDialogOpen);
85+
6986
return (
7087
<Layout>
7188
<VerticalFlexContainer>
72-
<VotingInfo
73-
currentLocale={currentLocale}
74-
currentDateFormat={currentDateFormat}
75-
currentTimeFormat={currentTimeFormat}
76-
isRegistrationEnded={isRegistrationEnded}
77-
onRegisterToVoteClick={() =>
78-
actions.dialogs.open.trigger({
79-
dialog: VotingRegistrationDialog,
80-
})
81-
}
82-
onExternalLinkClick={openExternalLink}
83-
/>
89+
{innerContent}
90+
<VotingFooterLinks onClickExternalLink={openExternalLink} />
8491
</VerticalFlexContainer>
8592

8693
{isVotingRegistrationDialogOpen && (

0 commit comments

Comments
 (0)