From b6136cb1ad81166ff6baaec651aebfc14fd8940d Mon Sep 17 00:00:00 2001 From: Richard Wong Date: Thu, 19 Oct 2023 08:40:45 +0900 Subject: [PATCH] Feat: re-organized each DEP to be its own main section --- src/App.css | 50 --------------------------- src/App.jsx | 45 ------------------------ src/MultiCheckbox.jsx | 51 --------------------------- src/ReactCheckboxTree.jsx | 71 -------------------------------------- src/VerseSampler.jsx | 68 ++++++++++++++++++++++-------------- src/VerseValidateLogic.jsx | 45 ------------------------ src/assets/verse.json | 42 +++++++++++++++------- 7 files changed, 73 insertions(+), 299 deletions(-) delete mode 100644 src/App.css delete mode 100644 src/App.jsx delete mode 100644 src/MultiCheckbox.jsx delete mode 100644 src/ReactCheckboxTree.jsx delete mode 100644 src/VerseValidateLogic.jsx diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 1428803..0000000 --- a/src/App.css +++ /dev/null @@ -1,50 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} - -.box-label { - padding: 5px; -} - -.verse-box { - padding: 5px; -} diff --git a/src/App.jsx b/src/App.jsx deleted file mode 100644 index 4acfb91..0000000 --- a/src/App.jsx +++ /dev/null @@ -1,45 +0,0 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' - - - -function App() { - const [inputVerse, setVerse] = useState('') - const [resultBool, setBool] = useState(false) - const verseChange = (e) => { - const value = e.target.value - let string1 = value; - let string2 = refVerse; - console.log(refVerse); - console.log(value); - string1 = String(string1).replace(/[^\w\s]/g, "").replace(/\s+/g, " ").toLowerCase(); - string2 = String(string2).replace(/[^\w\s]/g, "").replace(/\s+/g, " ").toLowerCase(); - - const bool = string1 === string2; - - setVerse(value) - setBool(bool) - } - - const refVerse = "Therefore, if anyone is in Christ, he is a new creation; the old has gone, the new has come!"; - - - return ( -
- - -

{inputVerse}

-

{String(resultBool)}

-
- ) -} - -export default App diff --git a/src/MultiCheckbox.jsx b/src/MultiCheckbox.jsx deleted file mode 100644 index 4373b46..0000000 --- a/src/MultiCheckbox.jsx +++ /dev/null @@ -1,51 +0,0 @@ -import VerseData from "./assets/verse.json" -import { useState } from "react"; - - -const ButtonMapper = ({todos, setTodos}) => { - return ( - todos.map(({ task, done }, i) => ( -
- -
- ) -))} - -const handleChange = (setTodos, todos, done, i) => { - // extract desired item - let tmp = todos[i]; - tmp.done = !done; - // clone existing array - let todosClone = [...todos]; - // assign modified item back - todosClone[i] = tmp; - setTodos([...todosClone]); -}; - - - -function App() { - const [todos, setTodos] = useState([ - { task: "Pick up groceries", done: false }, - { task: "Buy Milk", done: true }, - { task: "Complete Project X", done: false }, - ]); - - - return ( -
- -

Total Completed: {todos.filter((todo) => todo.done).length}

-
- ) -} - -export default App diff --git a/src/ReactCheckboxTree.jsx b/src/ReactCheckboxTree.jsx deleted file mode 100644 index 3e99565..0000000 --- a/src/ReactCheckboxTree.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from 'react'; -import { useState } from "react"; -import CheckboxTree from 'react-checkbox-tree'; -import 'react-checkbox-tree/lib/react-checkbox-tree.css'; -// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' - -const nodes = [ - { - value: 'loa', - label: 'Lessons on Assurance' - }, - { - value: 'tms60', - label: 'TMS60', - children: [ - { value: 'pack-a', label: 'Pack A' }, - { value: 'pack-b', label: 'Pack B' }, - { value: 'pack-c', label: 'Pack C' }, - { value: 'pack-d', label: 'Pack D' }, - { value: 'pack-e', label: 'Pack E' } - ] - }, - { - value: 'dep', - label: 'DEP', - children: [ - { value: 'dep1', label: 'DEP 1' }, - { value: 'dep2', label: 'DEP 2' }, - { value: 'dep3', label: 'DEP 3' }, - { value: 'dep4', label: 'DEP 4' } - ] - } -]; - -// class Widget extends React.Component { -// state = { -// checked: [], -// expanded: [], -// }; -// -// render() { -// return ( -// this.setState({ checked })} -// onExpand={expanded => this.setState({ expanded })} -// /> -// ); -// } -// } - -function Widget() { - const [checked, setChecked] = useState([]) - const [expanded, setExpanded] = useState([]) - console.log(checked) - return ( -
- -
- ); -} - -export default Widget \ No newline at end of file diff --git a/src/VerseSampler.jsx b/src/VerseSampler.jsx index 09cde52..b6a6554 100644 --- a/src/VerseSampler.jsx +++ b/src/VerseSampler.jsx @@ -33,30 +33,54 @@ const ArrayTester = ({ array }) => { const nodes = [ { - value: 'loa', - label: 'Lessons on Assurance' + value: "loa", + label: "Lessons on Assurance", }, { - value: 'tms60', - label: 'TMS60', + value: "tms60", + label: "TMS60", children: [ - { value: 'tms-60-pack-a', label: 'Pack A' }, - { value: 'tms-60-pack-b', label: 'Pack B' }, - { value: 'tms-60-pack-c', label: 'Pack C' }, - { value: 'tms-60-pack-d', label: 'Pack D' }, - { value: 'tms-60-pack-e', label: 'Pack E' } - ] + { value: "tms-60-pack-a", label: "Living the New Life" }, + { value: "tms-60-pack-b", label: "Proclaiming Christ" }, + { value: "tms-60-pack-c", label: "Reliance on God's Resources" }, + { value: "tms-60-pack-d", label: "Being Christ's Disciple" }, + { value: "tms-60-pack-e", label: "Growth in Christlikeness" }, + ], }, { - value: 'dep', - label: 'DEP', + value: "dep-1", + label: "DEP 1", + }, + { + value: "dep-2", + label: "DEP 2", children: [ - { value: 'dep-1', label: 'DEP 1' }, - { value: 'dep-2', label: 'DEP 2' }, - { value: 'dep-3', label: 'DEP 3' }, - { value: 'dep-4', label: 'DEP 4' } - ] - } + { value: "dep-2-part-a", label: "Why do we have Quiet Time?" }, + { value: "dep-2-part-b", label: "What is Quiet Time?" }, + { value: "dep-2-part-c", label: "Examples of Quiet Time" }, + ], + }, + { + value: "dep-3", + label: "DEP 3", + children: [ + { value: "dep-3-part-a", label: "Authority of the Word" }, + { value: "dep-3-part-b", label: "Value of the Word" }, + { value: "dep-3-part-c", label: "Attitude to the Word" }, + { value: "dep-3-part-d", label: "How to take in the Word (Word Hand Illustration)" } + ], + }, + { + value: "dep-4", + label: "DEP 4", + children: [ + { value: "dep-4-part-a", label: "Command of Prayer" }, + { value: "dep-4-part-b", label: "Promises and Blessings of Prayer" }, + { value: "dep-4-part-c", label: "Conditions for Answered Prayer" }, + { value: "dep-4-part-d", label: "Examples of Prayer" }, + { value: "dep-4-part-e", label: "Prayer Hand Illustration" } + ], + }, ]; const CheckboxWidget = ({checked, expanded, setChecked, setExpanded}) => { @@ -83,6 +107,7 @@ function App() { // 1. packObj.pack for the pack name // 2. packObj.include for whether to include the pack const packObjList = packList.map((element) => { + // create object for each element in VerseData key list const packObj = new Object(); packObj.pack = element; packObj.include = false; @@ -128,13 +153,6 @@ function App() { setExpanded={setExpanded} /> - {/*
-

Packs Tested:

- {checked - .map((element) => ( -
  • {element}
  • - ))} -
    */}

    Verses:

    diff --git a/src/VerseValidateLogic.jsx b/src/VerseValidateLogic.jsx deleted file mode 100644 index a2a8a3e..0000000 --- a/src/VerseValidateLogic.jsx +++ /dev/null @@ -1,45 +0,0 @@ -import { useState } from 'react' -// import reactLogo from './assets/react.svg' -// import viteLogo from '/vite.svg' -import './App.css' - - - -function App() { - const [inputVerse, setVerse] = useState('') - const [resultBool, setBool] = useState(false) - const verseChange = (e) => { - const value = e.target.value - let string1 = value; - let string2 = refVerse; - console.log(refVerse); - console.log(value); - string1 = String(string1).replace(/[^\w\s]/g, "").replace(/\s+/g, " ").toLowerCase(); - string2 = String(string2).replace(/[^\w\s]/g, "").replace(/\s+/g, " ").toLowerCase(); - - const bool = string1 === string2; - - setVerse(value) - setBool(bool) - } - - const refVerse = "Therefore, if anyone is in Christ, he is a new creation; the old has gone, the new has come!"; - - - return ( -
    - - -

    {inputVerse}

    -

    {String(resultBool)}

    -
    - ) -} - -export default App diff --git a/src/assets/verse.json b/src/assets/verse.json index ee02814..80d78e8 100644 --- a/src/assets/verse.json +++ b/src/assets/verse.json @@ -594,7 +594,7 @@ "verse": "And you also were included in Christ when you heard the word of truth, the gospel of your salvation. Having believed, you were marked in him with a seal, the promised Holy Spirit" } ], - "dep-2": [ + "dep-2-part-a": [ { "pack": "DEP 2", "title": "God wants to fellowship with us", @@ -650,7 +650,9 @@ "chapterTitle": "Why do we have Quiet Time", "reference": "Psalm 143:8,10", "verse": "Let the morning bring me word of your unfailing love, for I have put my trust in you. Show me the way I should go, for to you I lift up my soul. Teach me to do your will, for you are my God; may your good Spirit lead me on level ground." - }, + } + ], + "dep-2-part-b": [ { "pack": "DEP 2", "title": "Looking on the Lord", @@ -748,7 +750,9 @@ "chapterTitle": "What is Quiet Time", "reference": "Psalms 107:9", "verse": "for he satisfies the thirsty and fills the hungry with good things." - }, + } + ], + "dep-2-part-c": [ { "pack": "DEP 2", "title": "Jesus - praying very early in the morning", @@ -778,7 +782,7 @@ "verse": "He did not say anything to them without using a parable. But when he was alone with his own disciples, he explained everything." } ], - "dep-3": [ + "dep-3-part-a": [ { "pack": "DEP 3", "title": "Inspired by God", @@ -848,7 +852,9 @@ "chapterTitle": "Authority of the Word", "reference": "Luke 24:27", "verse": "And beginning with Moses and all the Prophets, he explained to them what was said in all the Scriptures concerning himself." - }, + } + ], + "dep-3-part-b": [ { "pack": "DEP 3", "title": "Making us born again", @@ -925,7 +931,9 @@ "chapterTitle": "Value of the Word", "reference": "Hebrews 4:12", "verse": "For the word of God is living and active. Sharper than any double--edged sword, it penetrates even to dividing soul and spirit, joints and marrow; it judges the thoughts and attitudes of the heart." - }, + } + ], + "dep-3-part-c": [ { "pack": "DEP 3", "title": "Search the Word every day", @@ -961,7 +969,9 @@ "chapterTitle": "Attitude to the Word", "reference": "Luke 5:5-6", "verse": "Simon answered, Master, we've worked hard all night and haven't caught anything. But because you say so, I will let down the nets. When they had done so, they caught such a large number of fish that their nets began to break." - }, + } + ], + "dep-3-part-d": [ { "pack": "DEP 3", "title": "Hearing", @@ -1033,7 +1043,7 @@ "verse": "Do not let this Book of the Law depart from your mouth; meditate on it day and night, so that you may be careful to do everything written in it. Then you will be prosperous and successful." } ], - "dep-4": [ + "dep-4-part-a": [ { "pack": "DEP 4", "title": "Cease not to pray", @@ -1061,7 +1071,9 @@ "chapterTitle": "Command of Prayer", "reference": "1 Timothy 2:1-2", "verse": "I urge, then, first of all, that requests, prayers, intercession and thanksgiving be made for everyone--for kings and all those in authority, that we may live peaceful and quiet lives in all godliness and holiness." - }, + } + ], + "dep-4-part-b": [ { "pack": "DEP 4", "title": "Promise to answer", @@ -1117,7 +1129,9 @@ "chapterTitle": "Promises and blessings of prayer", "reference": "Colossians 4:3", "verse": "And pray for us, too, that God may open a door for our message, so that we may proclaim the mystery of Christ, for which I am in chains." - }, + } + ], + "dep-4-part-c": [ { "pack": "DEP 4", "title": "Pray in the name of Jesus", @@ -1187,7 +1201,9 @@ "chapterTitle": "Conditions for answered prayer", "reference": "Nehemiah 1:8-9", "verse": "Remember the instruction you gave your servant Moses, saying, 'If you are unfaithful, I will scatter you among the nations, but if you return to me and obey my commands, then even if your exiled people are at the farthest horizon, I will gather them from there and bring them to the place I have chosen as a dwelling for my Name.'" - }, + } + ], + "dep-4-part-d": [ { "pack": "DEP 4", "title": "Praying at the risk of life", @@ -1222,7 +1238,9 @@ "chapterTitle": "Examples of prayer", "reference": "Acts 16:25", "verse": "About midnight Paul and Silas were praying and singing hymns to God, and the other prisoners were listening to them." - }, + } + ], + "dep-4-part-e": [ { "pack": "DEP 4", "title": "Praising",