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

styles: update node buttons #4962

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/scripts/components/admin/nodes/NewNodeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import AdminContentBlock from '@/components/admin/AdminContentBlock';
import NodeLimitContainer from '@/components/admin/nodes/NodeLimitContainer';
import NodeListenContainer from '@/components/admin/nodes/NodeListenContainer';
import NodeSettingsContainer from '@/components/admin/nodes/NodeSettingsContainer';
import Button from '@/components/elements/Button';
import { Button } from '@/components/elements/button/index';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea if your change is right, if it is. Just use

import { Button } from '@/components/elements/button';

import FlashMessageRender from '@/components/FlashMessageRender';
import type { ApplicationStore } from '@/state';

Expand Down Expand Up @@ -95,7 +95,7 @@ export default () => {
})}
>
{({ isSubmitting, isValid }) => (
<Form>
<Form className="mt-4">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's twin.marco usage?

<div css={tw`flex flex-col lg:flex-row`}>
<div css={tw`w-full lg:w-1/2 flex flex-col mr-0 lg:mr-2`}>
<NodeSettingsContainer />
Expand Down
11 changes: 9 additions & 2 deletions resources/scripts/components/admin/nodes/NodeDeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { useState } from 'react';
import tw from 'twin.macro';

import deleteNode from '@/api/admin/nodes/deleteNode';
import Button from '@/components/elements/Button';
import { Button } from '@/components/elements/button/index';
import ConfirmationModal from '@/components/elements/ConfirmationModal';
import type { ApplicationStore } from '@/state';
import { Size, Variant, Shape } from '@/components/elements/button/types';

interface Props {
nodeId: number;
Expand Down Expand Up @@ -52,7 +53,13 @@ export default ({ nodeId, onDeleted }: Props) => {
Are you sure you want to delete this node?
</ConfirmationModal>

<Button type={'button'} size={'xsmall'} color={'red'} onClick={() => setVisible(true)}>
<Button
type={'button'}
shape={Shape.IconSquare}
size={Size.Small}
variant={Variant.Danger}
onClick={() => setVisible(true)}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import NodeLimitContainer from '@/components/admin/nodes/NodeLimitContainer';
import NodeListenContainer from '@/components/admin/nodes/NodeListenContainer';
import { Context } from '@/components/admin/nodes/NodeRouter';
import NodeSettingsContainer from '@/components/admin/nodes/NodeSettingsContainer';
import Button from '@/components/elements/Button';
import { Button } from '@/components/elements/button/index';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea if your change is right, if it is. Just use

import { Button } from '@/components/elements/button';

import type { ApplicationStore } from '@/state';

interface Values {
Expand Down Expand Up @@ -118,7 +118,7 @@ export default () => {
</div>

<div css={tw`rounded shadow-md bg-neutral-700 mt-4 py-2 px-6`}>
<div css={tw`flex flex-row`}>
<div css={tw`flex flex-row items-center`}>
<NodeDeleteButton nodeId={node?.id} onDeleted={() => navigate('/admin/nodes')} />
<Button type={'submit'} css={tw`ml-auto`} disabled={isSubmitting || !isValid}>
Save Changes
Expand Down