Skip to content

Commit

Permalink
fix: styles issues (#1035)
Browse files Browse the repository at this point in the history
* fix: status pill position

* fix: identity tooltip showing on mobile

* fix: mobile styles
  • Loading branch information
andyesp committed Jun 21, 2023
1 parent 5410ac3 commit db7ada3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/BurgerMenu/BurgerMenuContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type BurgerMenuContentProps = NavigationProps & {

const filtersInitialStatus = { categoryOpen: true, statusOpen: false, timeFrameOpen: false }

const OPEN_BURGER_HEIGHT = 740
const OPEN_BURGER_HEIGHT = 860
const SEARCH_TITLE_HEIGHT = 32
const CATEGORY_FILTER_HEIGHT = 407
const STATUS_FILTER_HEIGHT = 290
Expand Down
4 changes: 3 additions & 1 deletion src/components/Layout/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext
import useFormatMessage from 'decentraland-gatsby/dist/hooks/useFormatMessage'
import { Link } from 'decentraland-gatsby/dist/plugins/intl'
import { Button } from 'decentraland-ui/dist/components/Button/Button'
import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media/Media'
import { Popup } from 'decentraland-ui/dist/components/Popup/Popup'
import { Tabs } from 'decentraland-ui/dist/components/Tabs/Tabs'

Expand Down Expand Up @@ -46,6 +47,7 @@ const Navigation = ({ activeTab }: NavigationProps) => {
isDismissClicked: false,
isPopUpDismissed: false,
})
const isMobile = useMobileMediaQuery()

useEffect(
() =>
Expand Down Expand Up @@ -101,7 +103,7 @@ const Navigation = ({ activeTab }: NavigationProps) => {
{showDot && <Dot />}
</Tabs.Tab>
}
open={showDot && !dismissState.isPopUpDismissed}
open={!isMobile && showDot && !dismissState.isPopUpDismissed}
/>
</Link>
)}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Status/StatusPill.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.StatusPill {
display: flex;
}
38 changes: 18 additions & 20 deletions src/components/Status/StatusPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import React from 'react'

import classNames from 'classnames'
import { Link } from 'decentraland-gatsby/dist/plugins/intl'
import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media'
import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media/Media'

import { ProposalStatus } from '../../entities/Proposal/types'
import { getProposalStatusDisplayName, getProposalStatusShortName } from '../../entities/Proposal/utils'
import locations from '../../utils/locations'
import Pill, { PillColor, Props as PillProps } from '../Common/Pill'
import Check from '../Icon/Check'

import './StatusPill.css'

type Props = {
className?: string
status: ProposalStatus
Expand All @@ -29,33 +31,29 @@ const ColorsConfig: Record<ProposalStatus, PillColor> = {
}

const StatusPill = ({ className, status, size, isLink }: Props) => {
const isMobile = useMobileMediaQuery()

const style = status === (ProposalStatus.Enacted || ProposalStatus.OutOfBudget) ? 'shiny' : 'outline'
const pillClassNames = classNames('StatusPill', className)
const colorsConfig = ColorsConfig[status]
const showIcon = status === ProposalStatus.Enacted || status === ProposalStatus.Passed
const iconColor = status === ProposalStatus.Enacted ? 'var(--white-900)' : 'var(--green-800)'
const icon = showIcon ? <Check color={iconColor} /> : null

const Wrapper = isLink ? Link : 'div'
const href = isLink ? locations.proposals({ status: status }) : undefined
const name = isMobile ? getProposalStatusShortName(status) : getProposalStatusDisplayName(status)
const pillSize = isMobile ? 'small' : size || 'default'

return (
<>
<Mobile>
<Wrapper href={href}>
<Pill size={'small'} style={style} className={pillClassNames} color={colorsConfig} icon={icon}>
{getProposalStatusShortName(status)}
</Pill>
</Wrapper>
</Mobile>
<NotMobile>
<Wrapper href={href}>
<Pill size={size || 'default'} style={style} className={pillClassNames} color={colorsConfig} icon={icon}>
{getProposalStatusDisplayName(status)}
</Pill>
</Wrapper>
</NotMobile>
</>
<Wrapper href={href} className="StatusPill">
<Pill
size={pillSize}
style={style}
className={classNames('StatusPill', className)}
color={ColorsConfig[status]}
icon={icon}
>
{name}
</Pill>
</Wrapper>
)
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/proposals.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}

.Animated {
width: 100%;
transition: all 0.5s ease 0s;
}

Expand Down
7 changes: 0 additions & 7 deletions src/pages/transparency.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
margin-bottom: 0;
}

.ui.container.TransparencyContainer {
display: flex;
justify-content: space-between;
align-content: stretch;
flex-wrap: wrap;
}

.ui.container.TransparencyContainer .ActionableLayout {
position: relative;
margin-top: 40px;
Expand Down

0 comments on commit db7ada3

Please sign in to comment.