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

Feat/captions #535

Merged
merged 2 commits into from
Aug 9, 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
2 changes: 2 additions & 0 deletions src/models/howto.models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IHowtoStep extends IHowToStepFormInput {
images: IUploadedFileMeta[]
title: string
text: string
caption?: string
_animationKey?: string
}

Expand All @@ -39,4 +40,5 @@ export interface IHowtoFormInput {
slug: string
// note, tags will remain optional as if populated {} will be stripped by db (firestore)
tags?: ISelectedTags
caption?: string
}
5 changes: 5 additions & 0 deletions src/pages/Howto/Content/CreateHowto/CreateHowto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ export class CreateHowto extends React.Component<IProps, IState> {
validateFields={[]}
component={ImageInputField}
/>
<Field
name="caption"
component={InputField}
placeholder="Insert Caption"
/>
<Field name="files" component={FileInputField} />
</BoxContainer>
</FlexContainer>
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Howto/Content/CreateHowto/Step/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ class Step extends Component<IProps, IState> {
{/* right */}
<BoxContainer p={0} width={[1, '305px', null]}>
<Field name={`${step}.images`} component={ImageInputField} multi />
<Field
name={`${step}.caption`}
component={InputField}
placeholder="Insert Caption"
/>
</BoxContainer>
</FlexContainer>
</BoxContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export default class HowtoDescription extends React.PureComponent<IProps, any> {
))}
</Box>
<Flex justifyContent={'end'} width={[1 / 2]}>
<CoverImg src={howto.cover_image.downloadUrl} alt="how-to cover" />
<Box>
<CoverImg src={howto.cover_image.downloadUrl} alt="how-to cover" />
<Text pt={2}>{howto.caption}</Text>
</Box>
</Flex>
</Flex>
)
Expand Down
1 change: 1 addition & 0 deletions src/pages/Howto/Content/Howto/Step/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class Step extends React.PureComponent<IProps> {
<Linkify>{this.props.step.text}</Linkify>
</Text>
<ImageGallery images={this.props.step.images as IUploadedFileMeta[]} />
<Text pb={3}>{this.props.step.caption}</Text>
</Box>
)
}
Expand Down