Skip to content

Commit

Permalink
feat: add example dir structure, customize col
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 15, 2024
1 parent 9043097 commit 26579ff
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ import {
restrictToVerticalAxis,
} from '@dnd-kit/modifiers';
import { verticalListSortingStrategy } from '@dnd-kit/sortable';
import { ExampleLink } from './ExampleLink';
import { Launch } from '@carbon/react/icons';
import * as packageJson from '../package.json';
import * as packageJson from '../../package.json';

type Resource = {
id: string;
Expand Down Expand Up @@ -97,24 +96,6 @@ export const CustomizeColumns = () => {
<TableContainer
title="Customize column order"
className="basic-table tanstack-example"
description={
<span className="flex">
<ExampleLink
url={`${import.meta.env.VITE_CODE_SANDBOX_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="Code sandbox"
/>
<ExampleLink
url={`${import.meta.env.VITE_STACK_BLITZ_URL_ROOT}/${
packageJson.name
}`}
icon={Launch}
label="StackBlitz"
/>
</span>
}
style={{
width: table.getCenterTotalSize(),
}}>
Expand Down
12 changes: 12 additions & 0 deletions react/customizeColumns/src/Example/Example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Grid, Column } from '@carbon/react';
import { CustomizeColumns } from './CustomizeColumns';

export const Example = () => {
return (
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<CustomizeColumns />
</Column>
</Grid>
);
};
File renamed without changes.
1 change: 1 addition & 0 deletions react/customizeColumns/src/Example/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Example } from './Example';
File renamed without changes.
9 changes: 0 additions & 9 deletions react/customizeColumns/src/ExampleLink.tsx

This file was deleted.

15 changes: 2 additions & 13 deletions react/customizeColumns/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,11 @@
$font-path: '@ibm/plex'
);
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/spacing' as *;
@use '@carbon/ibm-products/css/index';
@use './App';

body {
margin: 0;
padding: 0;
}

.example--link {
@include type.type-style('label-01');

display: flex;
align-items: center;
margin-right: 0.5rem;
}

.example--link__icon {
margin-right: 0.25rem;
margin-top: $spacing-10;
}
3 changes: 0 additions & 3 deletions react/customizeColumns/src/index.ts

This file was deleted.

11 changes: 2 additions & 9 deletions react/customizeColumns/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import {
CodeSnippet,
Column,
Grid,
Header,
HeaderContainer,
HeaderName,
} from '@carbon/react';

import { CustomizeColumns } from './CustomizeColumns';

import './index.scss';
import { Example } from './Example';

const renderUIShellHeader = () => (
<HeaderContainer
Expand All @@ -32,10 +29,6 @@ const renderUIShellHeader = () => (
createRoot(document.getElementById('root')!).render(
<StrictMode>
{renderUIShellHeader()}
<Grid className="page-grid">
<Column sm={4} md={8} lg={16}>
<CustomizeColumns />
</Column>
</Grid>
<Example />
</StrictMode>
);
2 changes: 1 addition & 1 deletion react/customizeColumns/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": [ "./src/customTypings.d.ts" ],
"types": ["./src/Example/customTypings.d.ts"],
"resolveJsonModule": true
},
"include": ["./src"]
Expand Down

0 comments on commit 26579ff

Please sign in to comment.