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

docs: corretta documentazione per notification #1106

Merged
merged 2 commits into from
Sep 16, 2024
Merged
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
97 changes: 1 addition & 96 deletions stories/Components/Notification.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,99 +315,4 @@ export const FixedPositions: Story = {
</div>
);
}
};

export const NotificationOptionsComponent_Fake = () => {
return null;
};

//Componenti non usati ma presenti nella precedente documentazione

/*

export const _NotificationWithMessage_story_hidden: Story = {
render: () => {
return (
<div>
<Button
onClick={() =>
notify(
'Titolo Notifica',
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor…</p>
)
}
>
Genera Notifica standard
</Button>
<Button
onClick={() =>
notify(
'Titolo Notifica',
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor…</p>,
{ state: 'success' }
)
}
>
Genera Notifica con icona
</Button>
<NotificationManager />
</div>
);
},
parameters: {
// disables Chromatic's snapshotting on a story level
chromatic: { disableSnapshot: true }
}
};

export const EsempioInterattivo: Story = {
render: ({
title,
message,
duration,
icon,
state,
fix,
dismissable,
closeOnClick
}) => {
return (
<div>
<Button onClick={() => notify(title, message, { duration, icon, state, dismissable })}>Mostra Notifica</Button>
<Button onClick={() => notify.dismiss()}>Chiudi tutte le notifiche</Button>
<NotificationManager fix={fix} closeOnClick={closeOnClick} />
</div>
);
},
parameters : { controls: { expanded: true } }
args : {
title: 'Titolo',
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor…',
fix: undefined,
dismissable: false,
closeOnClick: false,
duration: 6000,
icon: undefined,
state: undefined
},
argTypes : {
fix: {
control: {
type: 'select',
options: [undefined, 'top', 'bottom', 'right', 'left']
}
},
state: {
control: {
type: 'select',
options: [undefined, 'success', 'error', 'info', 'warning']
}
},
icon: {
control: {
type: 'select',
options: [undefined, 'it-tool', 'it-camera', 'it-check', 'it-calendar']
}
}
};
}; */
};
6 changes: 1 addition & 5 deletions stories/Documentation/Notification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ La funzione `notify` ha la seguente firma:
notify(title, message?, options?);
```

### NotificationOptions

Il dettaglio del tipo `NotificationOptions` è riportato di seguito:

<ArgTypes of={NotificationStories.NotificationOptionsComponent_Fake} />
<ArgTypes of={NotificationManager} />

# Stile notifiche

Expand Down
2 changes: 0 additions & 2 deletions test/__snapshots__/Storybook.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7747,8 +7747,6 @@ exports[`Stories Snapshots Documentazione/Componenti/Notification FixedPositions
</div>
`;

exports[`Stories Snapshots Documentazione/Componenti/Notification NotificationOptionsComponent_Fake 1`] = `<div />`;

exports[`Stories Snapshots Documentazione/Componenti/Notification States 1`] = `
<div>
<div
Expand Down
Loading