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

refactor(ally): changing elements order #3337

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import { DBDrawer } from '@db-ui/ngx-components';
```html app.component.html
<!-- app.component.html -->

<db-button (click)="toggleDrawer(true)"> Open me </db-button>
<db-drawer [open]="openDrawer" (onClose)="toggleDrawer(false)">
My Drawer content
</db-drawer>
<db-button (click)="toggleDrawer(true)"> Open me </db-button>
```

```ts app.component.ts
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/components/drawer/docs/React.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const App = () => {
const [open, setOpen] = useState<boolean>(false);
return (
<div>
<DBButton
onClick={() => {
setOpen(true);
}}
>
Open Me
</DBButton>
<DBDrawer
open={open}
onClose={() => {
Expand All @@ -25,13 +32,6 @@ const App = () => {
>
My Drawer content
</DBDrawer>
<DBButton
onClick={() => {
setOpen(true);
}}
>
Open Me
</DBButton>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/drawer/docs/Vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const toggleDrawer = (open: boolean) => {
</script>

<template>
<DBButton @click="toggleDrawer(true)">Open me</DBButton>
<DBDrawer :open="openDrawer" @close="toggleDrawer(false)">
My Drawer content
</DBDrawer>
<DBButton @click="toggleDrawer(true)">Open me</DBButton>
</template>
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
let-exampleIndex="exampleIndex"
let-variantIndex="variantIndex"
>
<db-button (click)="toggleDrawer(exampleName)">
Open: {{ exampleName }}
</db-button>
<db-drawer
[backdrop]="exampleProps?.backdrop"
[rounded]="exampleProps?.rounded"
Expand All @@ -21,8 +24,5 @@
>
{{ exampleName }}
</db-drawer>
<db-button (click)="toggleDrawer(exampleName)">
Open: {{ exampleName }}
</db-button>
</ng-template>
</app-default-component>
12 changes: 6 additions & 6 deletions showcases/react-showcase/src/components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const getDrawer = ({
backdrop
}: DBDrawerProps & AdditionalDrawerProperties) => (
<div>
<DBButton
onClick={() => {
setOpenDrawer(id);
}}>
Open: {children}
</DBButton>
<DBDrawer
rounded={rounded}
width={width}
Expand All @@ -34,12 +40,6 @@ const getDrawer = ({
}}>
{children}
</DBDrawer>
<DBButton
onClick={() => {
setOpenDrawer(id);
}}>
Open: {children}
</DBButton>
</div>
);

Expand Down
6 changes: 3 additions & 3 deletions showcases/vue-showcase/src/components/drawer/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const toggleDrawer = (example?: string) => {
<template
#example="{ exampleIndex, variantIndex, exampleName, exampleProps }"
>
<DBButton @click="toggleDrawer(exampleName)">
Open: {{ exampleName }}
</DBButton>
<DBDrawer
:backdrop="exampleProps?.backdrop"
:rounded="exampleProps?.rounded"
Expand All @@ -27,9 +30,6 @@ const toggleDrawer = (example?: string) => {
>
{{ exampleName }}
</DBDrawer>
<DBButton @click="toggleDrawer(exampleName)">
Open: {{ exampleName }}
</DBButton>
</template>
</DefaultComponent>
</template>
Loading