Skip to content

Commit

Permalink
Merge 500c4f4 into 9a18c2b
Browse files Browse the repository at this point in the history
  • Loading branch information
drydenwilliams authored Oct 18, 2019
2 parents 9a18c2b + 500c4f4 commit bddb311
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
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

0 comments on commit bddb311

Please sign in to comment.