-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
55 additions
and
180 deletions.
There are no files selected for viewing
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,16 @@ | ||
import styled from 'styled-components'; | ||
import { defaultTransitionCSS } from '../animations/transitions'; | ||
import { getColor } from '../theme/getters'; | ||
import { interactiveCSS } from '../utils/interactiveCSS'; | ||
import { Text } from '.'; | ||
|
||
export const ShyLinkText = styled(Text)` | ||
color: ${getColor('textSupporting')}; | ||
${interactiveCSS}; | ||
${defaultTransitionCSS} | ||
font-size: 14px; | ||
:hover { | ||
color: ${getColor('text')}; | ||
} | ||
`; |
16 changes: 1 addition & 15 deletions
16
apps/enterprise/src/pages/create-proposal/Header.module.sass
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
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 |
---|---|---|
@@ -1,21 +1,11 @@ | ||
.root | ||
&.compact | ||
background-color: var(--section-background-color) | ||
padding: 32px 48px | ||
.searchInput | ||
width: 380px | ||
.results | ||
flex-grow: 1 | ||
justify-content: flex-end | ||
|
||
&:not(.compact) | ||
width: 100% | ||
.container | ||
border-bottom: 1px solid var(--section-background-color) | ||
padding-bottom: 32px | ||
.heading, .subHeading | ||
margin-bottom: 24px | ||
.searchInput | ||
width: 380px | ||
.results | ||
margin-top: 24px | ||
width: 100% | ||
.container | ||
border-bottom: 1px solid var(--section-background-color) | ||
padding-bottom: 32px | ||
.heading, .subHeading | ||
margin-bottom: 24px | ||
.searchInput | ||
width: 380px | ||
.results | ||
margin-top: 24px |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,41 @@ | ||
import { Stack } from 'lib/ui/Stack'; | ||
import classNames from 'classnames'; | ||
import { Text as DeprecatedText } from 'components/primitives'; | ||
import { HStack, VStack } from 'lib/ui/Stack'; | ||
import { ProposalTags } from 'pages/shared/ProposalTags'; | ||
import { forwardRef, Ref } from 'react'; | ||
import { useNavigate } from 'react-router'; | ||
import { useCurrentProposal } from './CurrentProposalProvider'; | ||
import styles from './Header.module.sass'; | ||
import { DaoLogoLink } from 'components/dao-logo/DaoLogoLink'; | ||
import { Text } from 'lib/ui/Text'; | ||
import { InternalLink } from 'lib/navigation/Link/InternalLink'; | ||
import { getDaoPath } from 'navigation'; | ||
import { ShyLinkText } from 'lib/ui/Text/ShyLinkText'; | ||
import { DAOLogo } from 'components/dao-logo'; | ||
|
||
interface HeaderProps { | ||
className?: string; | ||
compact?: boolean; | ||
} | ||
|
||
export const Header = forwardRef((props: HeaderProps, ref: Ref<HTMLDivElement>) => { | ||
const { className, compact = false } = props; | ||
|
||
const proposal = useCurrentProposal(); | ||
|
||
const navigate = useNavigate(); | ||
|
||
const title = ( | ||
<DeprecatedText className={styles.name} variant="heading2"> | ||
<Text style={{ marginRight: 8 }} as="span" color="shy"> | ||
#{proposal.id} | ||
</Text> | ||
{proposal.title} | ||
</DeprecatedText> | ||
); | ||
|
||
if (compact) { | ||
return ( | ||
<Stack direction="row" ref={ref} className={classNames(className, styles.root, styles.compact)}> | ||
<div className={styles.logo}> | ||
<DaoLogoLink address={proposal.dao.address} size="s" logo={proposal.dao.logo} /> | ||
</div> | ||
{title} | ||
<ProposalTags proposal={proposal} /> | ||
</Stack> | ||
); | ||
} | ||
const { dao } = proposal; | ||
|
||
return ( | ||
<Stack ref={ref} className={classNames(className, styles.root)} direction="column"> | ||
<Stack direction="row" className={styles.container}> | ||
<DeprecatedText className={styles.back} variant="link" onClick={() => navigate(-1)}> | ||
Back | ||
</DeprecatedText> | ||
<div className={styles.logo}> | ||
<DaoLogoLink address={proposal.dao.address} size="s" logo={proposal.dao.logo} /> | ||
</div> | ||
{title} | ||
<ProposalTags proposal={proposal} /> | ||
</Stack> | ||
</Stack> | ||
<VStack gap={16}> | ||
<InternalLink to={getDaoPath(proposal.dao.address)}> | ||
<ShyLinkText>Back</ShyLinkText> | ||
</InternalLink> | ||
<HStack alignItems="center" gap={20}> | ||
<HStack alignItems="center" gap={8}> | ||
<InternalLink to={getDaoPath(proposal.dao.address)}> | ||
<DAOLogo size="m" logo={dao.logo} /> | ||
</InternalLink> | ||
<Text as="h1"> | ||
<Text style={{ marginRight: 8 }} as="span" color="shy"> | ||
#{proposal.id} | ||
</Text> | ||
{proposal.title} | ||
</Text> | ||
<ProposalTags proposal={proposal} /> | ||
</HStack> | ||
</HStack> | ||
</VStack> | ||
); | ||
}); |
This file was deleted.
Oops, something went wrong.