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

✨ TopAppBarMenu - add custom menu #193

Merged

Conversation

AdrienCasta
Copy link
Contributor

@AdrienCasta AdrienCasta commented Feb 19, 2024

@AdrienCasta AdrienCasta force-pushed the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch 11 times, most recently from 75860c2 to 8a4461b Compare February 26, 2024 10:26
@AdrienCasta AdrienCasta force-pushed the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch from 8a4461b to acb5f8e Compare February 26, 2024 10:46
@AdrienCasta AdrienCasta marked this pull request as ready for review February 26, 2024 10:47
@AdrienCasta AdrienCasta force-pushed the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch from acb5f8e to a4b73d9 Compare February 28, 2024 09:04
onBack?: () => void;
style?: ViewStyle;
action?: ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

en fait ici le client de la lib va pouvoir venir donner directement l'icon + action en tant que child component ?

Copy link
Contributor Author

@AdrienCasta AdrienCasta Feb 28, 2024

Choose a reason for hiding this comment

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

Yes c'est l'idée ! On avait besoin de faire plus qu'afficher une icone et gérer onPress. Pour un soucis de simplicité, je redonne la main au consumer de la lib en laissant libre un AppBar.Action.
J'ai rajouté les icone "close" et "printer settings" dans le DS.

<TopAppBar title="" action={<TopAppBar.CloseAction  onPress={args.onMenuItemPress} />} />
<TopAppBar title="" action={<TopAppBar.PrinterSettingsAction onPress={args.onMenuItemPress} />}  />

Comment on lines 67 to 69
TopAppBar.CloseAction = TopAppBarCloseAction;
TopAppBar.MenuAction = TopAppBarMenuAction;
TopAppBar.PrinterSettingsAction = TopAppBarPrinterSettingsAction;
Copy link
Member

Choose a reason for hiding this comment

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

ici c'est des menus par defaut proposer par la lib ? Car je pense que par exemple le PrinterSettingsAction aurait plus sa place dans l'app directement et pas dans la lib.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

C'est ce qui est fait actuellement en insérant le name de l'icône actuellement, l'icone est côté DS :) J'ai pris la décision de partir garder l'action côté DS également

Copy link
Contributor

Choose a reason for hiding this comment

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

J'ai un doute aussi. Si on se projette dans le futur, je ne suis pas sûr que l'on veuille référencer toutes nos actions dans le DS. J'aurais donc mis les actions dans l'application et non dans le DS.

);
};

function getMenuItemConfig(theme: Theme, id: TopAppBarMenuItemId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Je ne vois pas l'intérêt de l'id. Tu peux m'expliquer ?

});
});

describe('TopAppBarMenuItem failing to mount', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Je ne comprends pas ce test. Je pense que c'est lié à l'id 🤔

expect(screen.getByText(topBarTitle)).toBeOnTheScreen();
});

it.todo("testing menu title 'as string' on press");
Copy link
Contributor

Choose a reason for hiding this comment

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

A implémenter ou supprimer 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Créer un ticket et lier le todo au ticket.

@clementdejoie clementdejoie force-pushed the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch from 07c1531 to 6b9d2c7 Compare February 29, 2024 11:08
@clementdejoie clementdejoie force-pushed the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch from 6b9d2c7 to 1ded399 Compare February 29, 2024 11:14
@AdrienCasta AdrienCasta merged commit 4c780f9 into main Feb 29, 2024
2 checks passed
@AdrienCasta AdrienCasta deleted the task/rew-287-modifier-la-topappbar-pour-integrer-un-sous-menu branch February 29, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants