Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

667 tags overlapping #701

Merged
merged 3 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/EventCard/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const EventCard = (props: IProps) => (
textAlign={'center'}
width={['auto', 'auto', 1]}
>
{getMonth(new Date(props.event.date))}
{getMonth(new Date(props.event.date), 'short')}
</Text>
</Flex>
</Flex>
Expand Down Expand Up @@ -106,9 +106,10 @@ export const EventCard = (props: IProps) => (
</Text>
</Flex>
<Flex
flexWrap={'nowrap'}
alignItems={'center'}
flex={'1'}
flex="1"
alignItems="flex-start"
justifyContent="center"
flexDirection="column"
order={[4, 4, 4]}
mb={[2, 2, 0]}
>
Expand All @@ -130,7 +131,7 @@ export const EventCard = (props: IProps) => (
mr={1}
width={1}
>
<Text auxiliary width={1}>
<Text auxiliary width={1} txtRight>
Go to event
</Text>
</GoToEventLink>
Expand Down
17 changes: 2 additions & 15 deletions src/components/Tags/TagDisplay/TagDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,7 @@ interface InjectedProps extends IProps {

const TagContainer = Styled(Text)`
position: relative;
display: inline;
padding-left: 8px;
::before {
content: '#';
position: absolute;
left: 0px;
top: 0px;
}
margin-bottom: 4px;
`

@inject('tagsStore')
Expand All @@ -42,10 +33,6 @@ export default class TagDisplay extends React.Component<IProps> {
public render() {
const tag = this.injectedProps.tagsStore.allTagsByKey[this.props.tagKey]

return tag ? (
<TagContainer tags mr={2}>
{tag.label}
</TagContainer>
) : null
return tag ? <TagContainer tags>{`#${tag.label}`}</TagContainer> : null
}
}
5 changes: 5 additions & 0 deletions src/components/Text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface ITextProps {
txtcenter?: boolean
capitalize?: boolean
bold?: boolean
txtRight?: boolean

large?: boolean
medium?: boolean
Expand Down Expand Up @@ -41,6 +42,9 @@ export const inline = (props: ITextProps) =>
export const txtcenter = (props: ITextProps) =>
props.txtcenter ? { textAlign: 'center' } : null

export const txtRight = (props: ITextProps) =>
props.txtRight ? { textAlign: 'right' } : null

export const regular = (props: ITextProps) =>
props.regular ? { fontWeight: 400 } : null

Expand Down Expand Up @@ -104,6 +108,7 @@ export const BaseText = styled(RebassText)`
${tags}
${auxiliary}
${paragraph}
${txtRight}
`

type TextProps = ITextProps & RebassTextProps
Expand Down
4 changes: 2 additions & 2 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export const timestampToYear = (timestamp: number) => {
return date.getFullYear()
}

export const getMonth = (d: Date) => {
export const getMonth = (d: Date, monthType: string = 'long') => {
// use ECMAScript Internationalization API to return month
return `${d.toLocaleString('en-us', { month: 'long' })}`
return `${d.toLocaleString('en-us', { month: monthType })}`
}
export const getDay = (d: Date) => {
return `${d.getDate()}`
Expand Down