Skip to content

Commit

Permalink
Remove margin from button css and re-add where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
eikhr committed May 9, 2024
1 parent 7388ad4 commit b8cfb47
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 37 deletions.
3 changes: 2 additions & 1 deletion app/routes/admin/email/components/RestrictedMailEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, LinkButton } from '@webkom/lego-bricks';
import { Flex, Icon, LinkButton } from '@webkom/lego-bricks';
import { usePreparedEffect } from '@webkom/react-prepare';
import { Field } from 'react-final-form';
import { useNavigate, useParams } from 'react-router-dom';
Expand Down Expand Up @@ -218,6 +218,7 @@ const RestrictedMailEditor = () => {
/>

<SubmissionError />

{isNew && <SubmitButton>Lag flaskepost</SubmitButton>}
{!isNew && restrictedMailId && restrictedMail && (
<LinkButton
Expand Down
2 changes: 1 addition & 1 deletion app/routes/articles/components/ArticleEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const ArticleEditor = () => {
component={EditorField.Field}
/>

<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
<LinkButton flat href={`/articles/${isNew ? '' : articleId}`}>
Avbryt
</LinkButton>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/events/components/EventEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const EventEditor = () => {
/>
)}

<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
{isEditPage && (
<LinkButton flat href={`/events/${event.slug}`}>
Avbryt
Expand Down
2 changes: 1 addition & 1 deletion app/routes/forum/components/ForumEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ForumEditor = () => {
id="forum-description"
/>
{/* Action buttons */}
<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
<Button
flat
onPress={() =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/forum/components/ThreadEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const ThreadEditor = () => {
component={EditorField.Field}
/>

<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
<Button
flat
onPress={() =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/joblistings/components/JoblistingEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const JoblistingEditor = () => {
required
/>
<SubmissionError />
<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
<LinkButton href={`/joblistings/${isNew ? '' : joblistingId}`}>
Avbryt
</LinkButton>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/meetings/components/MeetingEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const MeetingEditor = () => {
)}

<SubmissionError />
<Flex wrap>
<Flex wrap gap="var(--spacing-md)">
<Button
flat
onPress={() =>
Expand Down
38 changes: 19 additions & 19 deletions app/routes/pages/components/PageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,6 @@ const PageEditor = () => {
placeholder="Velg kategori"
options={categoryOptions}
/>

<Flex margin="0 0 0 10px">
{!isNew && (
<ConfirmModal
title="Slett side"
message="Er du sikker på at du vil slette denne infosiden?"
onConfirm={onDelete}
>
{({ openConfirmModal }) => (
<Button onPress={openConfirmModal} danger>
<Icon name="trash" size={19} />
Slett
</Button>
)}
</ConfirmModal>
)}

<SubmitButton>{isNew ? 'Opprett' : 'Lagre'}</SubmitButton>
</Flex>
</Flex>

<Fields
Expand All @@ -211,6 +192,25 @@ const PageEditor = () => {
component={EditorField.Field}
uploadFile={uploadFile}
/>

<Flex wrap gap="var(--spacing-md)">
{!isNew && (
<ConfirmModal
title="Slett side"
message="Er du sikker på at du vil slette denne infosiden?"
onConfirm={onDelete}
>
{({ openConfirmModal }) => (
<Button onPress={openConfirmModal} danger>
<Icon name="trash" size={19} />
Slett
</Button>
)}
</ConfirmModal>
)}

<SubmitButton>{isNew ? 'Opprett' : 'Lagre'}</SubmitButton>
</Flex>
</Form>
)}
</TypedLegoForm>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/photos/components/GalleryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ const GalleryEditor = () => {
component={ObjectPermissions}
/>

<Flex className={styles.buttonRow} justifyContent="flex-end">
<Flex className={styles.buttonRow} wrap gap="var(--spacing-md)">
<LinkButton flat href={`/photos/${gallery?.id ?? ''}`}>
Avbryt
</LinkButton>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/photos/components/GalleryEditorActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const GalleryEditorActions = ({
<span>
<b>{selectedCount}</b> valgt
</span>
<Flex justifyContent="flex-end" wrap>
<Flex wrap gap="var(--spacing-md)">
<Button flat onPress={onDeselect}>
Avbryt
</Button>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/photos/components/GalleryPictureEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const GalleryPictureEditModal = () => {
component={SelectInput.AutocompleteField}
isMulti
/>
<Flex justifyContent="flex-end">
<Flex wrap gap="var(--spacing-md)">
<Button
flat
onPress={() => {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/polls/components/PollEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const PollEditor = ({
/>

<SubmissionError />
<Flex className={styles.actionButtons}>
<Flex className={styles.actionButtons} wrap gap="var(--spacing-md)">
<SubmitButton>
{editing ? 'Lagre endringer' : 'Lag ny avstemning'}
</SubmitButton>
Expand Down
6 changes: 3 additions & 3 deletions app/routes/users/components/RemovePicture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Icon } from '@webkom/lego-bricks';
import { Button, Flex, Icon } from '@webkom/lego-bricks';
import { useState } from 'react';
import { removePicture } from 'app/actions/UserActions';
import { useAppDispatch } from 'app/store/hooks';
Expand All @@ -22,7 +22,7 @@ const RemovePicture = (props: Props) => {
const toggleSelected = () => setSelected(!selected);

return (
<div>
<Flex wrap gap="var(--spacing-md)">
{selected ? (
<Button onPress={toggleSelected}>Avbryt</Button>
) : (
Expand All @@ -36,7 +36,7 @@ const RemovePicture = (props: Props) => {
Bekreft
</Button>
)}
</div>
</Flex>
);
};

Expand Down
4 changes: 0 additions & 4 deletions packages/lego-bricks/src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
opacity: 0.5;
}

+ .button {
margin-left: 16px;
}

> a {
color: var(--color-gray-8);
}
Expand Down

0 comments on commit b8cfb47

Please sign in to comment.