From 036e37a1201f3d9fa22b1bbe5b1f760c4d31bfac Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 26 Feb 2022 04:43:37 -0500 Subject: [PATCH] button UI --- .../tts_configs/TtsConfigsReorderPage.tsx | 13 +++- .../ReorderableTwitchEventRuleElement.tsx | 59 ++++++++++--------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/packages/storyteller/src/pages/tts_configs/TtsConfigsReorderPage.tsx b/packages/storyteller/src/pages/tts_configs/TtsConfigsReorderPage.tsx index 93c027a2ed..a453e92980 100644 --- a/packages/storyteller/src/pages/tts_configs/TtsConfigsReorderPage.tsx +++ b/packages/storyteller/src/pages/tts_configs/TtsConfigsReorderPage.tsx @@ -52,6 +52,14 @@ function TtsConfigsReorderPage(props: Props) { }, [listTwitchEventRules, event_category, history]); + const handleMoveUp = (ruleIndex: number) => { + + } + + const handleMoveDown = (ruleIndex: number) => { + + } + if (!props.sessionWrapper.isLoggedIn()) { return

Must Log In

; } @@ -76,10 +84,13 @@ function TtsConfigsReorderPage(props: Props) { - {twitchEventRules.map(rule => { + {twitchEventRules.map((rule, index) => { return })} diff --git a/packages/storyteller/src/pages/tts_configs/rule_cards/ReorderableTwitchEventRuleElement.tsx b/packages/storyteller/src/pages/tts_configs/rule_cards/ReorderableTwitchEventRuleElement.tsx index 4998ed6e8c..ffaab5a3d0 100644 --- a/packages/storyteller/src/pages/tts_configs/rule_cards/ReorderableTwitchEventRuleElement.tsx +++ b/packages/storyteller/src/pages/tts_configs/rule_cards/ReorderableTwitchEventRuleElement.tsx @@ -1,23 +1,32 @@ import React from 'react'; import { TwitchEventRule } from '@storyteller/components/src/api/storyteller/twitch_event_rules/ListTwitchEventRules'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faArrowDown, faArrowUp, faEdit, faExternalLinkAlt, faTrash } from '@fortawesome/free-solid-svg-icons'; -import { Link } from 'react-router-dom'; +import { faArrowDown, faArrowUp, faExternalLinkAlt, } from '@fortawesome/free-solid-svg-icons'; import { TtsModelListItem } from '@storyteller/components/src/api/tts/ListTtsModels'; interface Props { rule: TwitchEventRule, + + // Index of the rule in the parents' list + ruleIndex: number, + + // Update callbacks + handleMoveUp: (index: number) => void, + handleMoveDown: (index: number) => void, + + // FakeYou voices allTtsModelsByToken: Map, - hideButtons?: boolean, } function ReorderableTwitchEventRuleElement(props: Props) { - const hideButtons = !!props.hideButtons; - let title = "Not Set"; let subtitle = <>; let description = <>; + const handleClickUp = (ev: React.FormEvent) : boolean => { + return true; + } + if (props.rule.event_match_predicate.bits_cheermote_name_exact_match !== undefined) { title = "Cheermote Name Matches" subtitle = ( @@ -91,29 +100,6 @@ function ReorderableTwitchEventRuleElement(props: Props) { ); } - const editUrl = `/tts_configs/edit/${props.rule.token}`; - const deleteUrl = `/tts_configs/delete/${props.rule.token}`; - - let buttons = <>; - if (!hideButtons) { - buttons = ( - <> -
-
- -  Up - -
-
- -  Down - -
-
- - ) - } - return (
@@ -125,7 +111,22 @@ function ReorderableTwitchEventRuleElement(props: Props) { {description}
- {buttons} +
+
+ + + +
+
+ + + +
+