Skip to content

Commit

Permalink
remove seemingly unnecessary margin-bottom from the article form
Browse files Browse the repository at this point in the history
  • Loading branch information
twrichards committed Oct 14, 2024
1 parent 99a55ba commit 4f28d39
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions fronts-client/src/components/card/chef/ChefCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ChefCard = ({
{showMeta && (
<CardMetaContainer size={size} isToShowError={!chef}>
{!!chef ? (
<CardMetaHeading>Chef</CardMetaHeading>
<CardMetaHeading>Chef</CardMetaHeading>
) : (
<img
src={exclamationMarkIcon}
Expand All @@ -87,9 +87,9 @@ export const ChefCard = ({
<CardContent textSize={textSize} isToShowError={!chef}>
<CardHeadingContainer size={size}>
{!!chef ? (
<CardHeading data-testid="headline" html>
<CardHeading data-testid="headline" html>
{chef.webTitle}
</CardHeading>
</CardHeading>
) : (
<CardHeading data-testid="headline" isToShowError={!chef}>
This chef might not load in the app, please select an
Expand Down
2 changes: 1 addition & 1 deletion fronts-client/src/components/card/recipe/RecipeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const RecipeCard = ({
{showMeta && (
<CardMetaContainer size={size} isToShowError={!recipe}>
{!!recipe ? (
<CardMetaHeading>Recipe</CardMetaHeading>
<CardMetaHeading>Recipe</CardMetaHeading>
) : (
<img
src={exclamationMarkIcon}
Expand Down
2 changes: 1 addition & 1 deletion fronts-client/src/components/form/ChefMetaForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Form = ({
{`This collection has been edited since you started editing this article. Your changes have not been saved. Please refresh the page to get the latest data.`}
</CollectionEditedError>
)}
<FormContent size={size}>
<FormContent size={size} marginBottom="40px">
<TextOptionsInputGroup>
<Field
name="bio"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Form = ({
{`This collection has been edited since you started editing this article. Your changes have not been saved. Please refresh the page to get the latest data.`}
</CollectionEditedError>
)}
<FormContent size={size}>
<FormContent size={size} marginBottom="40px">
<TextOptionsInputGroup>
<Field
name="title"
Expand Down
8 changes: 6 additions & 2 deletions fronts-client/src/components/form/FormContent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { styled } from 'constants/theme';
import { CardSizes } from 'types/Collection';

interface FormContentProps {
size?: CardSizes;
marginBottom?: string;
}
export const FormContent = styled.div`
flex: 3;
display: flex;
flex-direction: ${(props: { size?: CardSizes }) =>
flex-direction: ${(props: FormContentProps) =>
props.size !== 'wide' ? 'column' : 'row'};
margin-bottom: 40px;
margin-bottom: ${(props: FormContentProps) => props.marginBottom ?? 0};
`;

0 comments on commit 4f28d39

Please sign in to comment.