diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 07be8ba..55402f7 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -14,7 +14,7 @@ "live_validation": "Enable live validation", "note_live_validation": "Check this box to enable live validation feedback as you type. Uncheck to only show correctness upon completion.", "pick_pack": "Pick your pack(s)", - "shuffle_card": "Shuffle Cards:", + "tools": "Tools:", "verses": "Verses:" }, "verse_validator": { diff --git a/public/locales/kn/translation.json b/public/locales/kn/translation.json index 30ebddd..1106508 100644 --- a/public/locales/kn/translation.json +++ b/public/locales/kn/translation.json @@ -14,7 +14,7 @@ "live_validation": "Enable live validation", "note_live_validation": "Check this box to enable live validation feedback as you type. Uncheck to only show correctness upon completion.", "pick_pack": "Pick your pack(s)", - "shuffle_card": "Shuffle Cards:", + "tools": "Tools:", "verses": "Verses:" }, "verse_validator": { diff --git a/src/VerseSampler.css b/src/VerseSampler.css index 14469e3..a6a7d73 100644 --- a/src/VerseSampler.css +++ b/src/VerseSampler.css @@ -28,3 +28,20 @@ color: black; } } + +.setting-disabled { + opacity: 0.5; +} + +.tool-bar { + display: flex; + gap: 10px; /* Adjust as needed */ + align-items: center; +} + +.lang-bar { + display: flex; + gap: 10px; /* Adjust as needed */ + align-items: center; +} + diff --git a/src/VerseSampler.jsx b/src/VerseSampler.jsx index f5c72ce..46eeb55 100644 --- a/src/VerseSampler.jsx +++ b/src/VerseSampler.jsx @@ -16,7 +16,7 @@ import logo from './assets/droplet.svg'; import { Suspense } from "react"; -const ArrayTester = ({ array, toHideReference, liveValidation, translate}) => { +const ArrayTester = ({ array, toHideReference, liveValidation, clearKey, translate}) => { const list = array.map((element, index) => ( // key needs to be unique; chose 3 elements that will separate all elements { element={element} toHideReference={toHideReference} liveValidation={liveValidation} + clearKey={clearKey} // Pass clearKey down t={translate} // this passes the t i18 object to the function index={index + 1} /> @@ -82,14 +83,20 @@ const loadCustomData = (language) => { function Page() { // refresh button for refresh - const RefreshButton = ({ onClick }) => { - return ; + const RefreshButton = ({ onClick, disabled }) => { + return ; }; // refresh variables where incrementing state forces refresh - const [refreshKey, setRefreshKey] = useState(0); - const handleRefresh = () => { + const [shuffleKey, setShuffleKey] = useState(0); + const handleShuffle = () => { // Increment the key to force a re-render - setRefreshKey(refreshKey => refreshKey + 1); + setShuffleKey(shuffleKey => shuffleKey + 1); + }; + + // New state for clearing all inputs + const [clearKey, setClearKey] = useState(0); + const handleClearAll = () => { + setClearKey(clearKey => clearKey + 1); }; // setup i18 for function @@ -191,7 +198,7 @@ function Page() { [] ); return toShuffle ? _.sample(list, testCount) : _.first(list, testCount); - }, [VerseData, checked, testCount, toShuffle, refreshKey]); + }, [VerseData, checked, testCount, toShuffle, shuffleKey]); @@ -199,8 +206,12 @@ function Page() {

{t('main.title')}

{t('main.pick_lang')}

- - + +
+ + +
+

{t('main.pick_num_verses')}