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(explorer): add funcitonality to remove networks #2401

Merged
merged 24 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7603cf4
start edit dialog
sstraatemans Jul 12, 2024
3a75bf4
remove network
sstraatemans Jul 12, 2024
1e66980
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 12, 2024
b428b87
add toast, when you want to try to remove a default network
sstraatemans Jul 12, 2024
5061770
fix routing when network does not exist
sstraatemans Jul 15, 2024
1e822ae
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 17, 2024
caef9c5
start for remove network
sstraatemans Jul 18, 2024
5a8f506
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 18, 2024
b66b0e8
validation of network
sstraatemans Jul 19, 2024
62ab1b4
adding a network
sstraatemans Jul 19, 2024
b874718
all functionality build in
sstraatemans Jul 19, 2024
189cb95
add styling
sstraatemans Jul 19, 2024
2c9b019
cleanup
sstraatemans Jul 19, 2024
c5781b1
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 19, 2024
6f972f2
fix the mediaquery for select network
sstraatemans Jul 19, 2024
4ec858f
show "selectnet work"
sstraatemans Jul 22, 2024
bf300f6
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 22, 2024
fdb0b1a
styling fix
sstraatemans Jul 22, 2024
d18f416
move the select networks dropdown
sstraatemans Jul 22, 2024
329aa94
fix build
sstraatemans Jul 22, 2024
6ba4b58
cleanup
sstraatemans Jul 22, 2024
dddf748
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 22, 2024
7a388b1
fix some styling. and add maximums to string names in form
sstraatemans Jul 22, 2024
2529df6
Merge branch 'main' into feat/explorer/editnetworks
sstraatemans Jul 22, 2024
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
5 changes: 5 additions & 0 deletions .changeset/long-flowers-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena/explorer': minor
---

add posibility to remove networks
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { atoms, responsiveStyle, token } from '@kadena/kode-ui/styles';
import { style } from '@vanilla-extract/css';

// NOTE: Padding is applied via this container instead of margin to the container to avoid margin collapse with the body
export const paddingContainer = style(
responsiveStyle({
md: {
paddingBlock: token('size.n32'),
},
}),
);

export const container = style([
atoms({
borderRadius: 'md',
padding: 'xl',
backgroundColor: 'layer.default',
}),
{
...responsiveStyle({
md: {
border: token('border.hairline'),
width: '42rem',
marginInlineStart: '50%',
transform: 'translateX(-50%)',
},
}),
},
]);

export const bodyContent = style([
{ marginBlockStart: token('spacing.xl'), flex: 1.5 },
{
...responsiveStyle({
md: {
marginBlockStart: token('size.n25'),
},
}),
selectors: {
"&[data-layout='no-visual']": responsiveStyle({
md: {
marginBlockStart: token('size.n10'),
},
}),
},
},
]);
88 changes: 88 additions & 0 deletions packages/apps/explorer/src/components/CardPattern/CardPattern.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { SpireKeyKdacolorLogoGreen } from '@kadena/kode-icons/product';
import { Box, Heading, Stack, Text } from '@kadena/kode-ui';
import { atoms, token } from '@kadena/kode-ui/styles';
import React from 'react';
import { bodyContent, container, paddingContainer } from './CardPattern.css';

export const CardContainer = ({ children }: { children: React.ReactNode }) => {
// TODO: replace with card component when it accepts className
return (
<div className={paddingContainer}>
<div className={container}>{children}</div>
</div>
);
};

interface CardContentBlockProps {
title: string;
visual?: React.ReactNode;
description?: string;
children: React.ReactNode;
}

export const CardContentBlock = ({
title,
visual,
description,
children,
}: CardContentBlockProps) => {
return (
<Stack flexDirection={{ xs: 'column', md: 'row' }} gap="md">
<Stack flexDirection="column" alignItems="flex-start" flex={1}>
<Box>{visual}</Box>
{title && (
<Heading
className={atoms({
marginBlockStart: 'sm',
marginBlockEnd: 'md',
})}
>
{title}
</Heading>
)}
{description && <Text as="p">{description}</Text>}
</Stack>
<Stack
flexDirection="column"
className={bodyContent}
data-layout={!visual && 'no-visual'}
>
{children}
</Stack>
</Stack>
);
};

interface CardFooterProps {
children: React.ReactNode;
separated?: boolean;
}

export const CardFooter = ({
children,
separated = false,
}: CardFooterProps) => {
return (
<Stack
marginBlockStart="xxl"
gap="md"
justifyContent={separated ? 'space-between' : 'flex-end'}
>
{children}
</Stack>
);
};

export const SpireKeyCardContentBlock = (
props: Omit<CardContentBlockProps, 'visual'>,
) => (
<CardContentBlock
{...props}
visual={
<SpireKeyKdacolorLogoGreen
aria-label="SpireKey"
fontSize={token('typography.fontSize.9xl')}
/>
}
/>
);
1 change: 1 addition & 0 deletions packages/apps/explorer/src/components/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Logo: FC = () => {
if (theme === 'dark') {
return (
<svg
style={{ width: '100%' }}
data-style="kdacolor"
width="230"
height="40"
Expand Down
5 changes: 4 additions & 1 deletion packages/apps/explorer/src/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export const NavBar: FC<
</Stack>
<Stack flex={1}>{children}</Stack>

<Stack>
<Stack alignItems="center">
<Media lessThan="md">
<SelectNetwork />
</Media>
<ThemeToggle />
<GraphQLQueryDialog />
</Stack>
Expand Down
Loading