-
Notifications
You must be signed in to change notification settings - Fork 10
feat(frontend): update create community flow #62
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
Merged
Merged
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
e5c770d
create ActionButton component
germanurrus c1d1b66
create components
germanurrus 5e876a5
add new tab
germanurrus 5ec001a
use mocked data
germanurrus 703199e
add component
germanurrus 1439d1e
add responsibe spacing
germanurrus b309dbb
Merge branch 'main' into cas-117
germanurrus edada72
add hover to strategy selector
germanurrus 9ab2654
add input component
germanurrus 8fe559b
create input component
germanurrus 0644248
update component
germanurrus 4472c01
updates
germanurrus 1a46905
extract state
germanurrus 47a9c5c
fix addbutton
germanurrus b1038fa
updates
germanurrus caea941
set state to null
germanurrus cfcf000
remove loader
germanurrus bb47fb1
update for one-address-one-vote
germanurrus 64c1287
remove output
germanurrus 7b9c3dd
change name
germanurrus 0de640e
assign null
germanurrus 80806b1
add enableDelete
germanurrus 159c7fa
Merge branch 'cas-120' into cas-117
germanurrus b114ff4
Merge branch 'main' into cas-117
germanurrus 56af811
hook function to save data to backend
germanurrus d8c87d4
remove wait
germanurrus 82fea89
Merge branch 'cas-117' into cas-132
germanurrus 9a157bc
extract Strategy Selector
germanurrus 30faea7
add new step
germanurrus 3dc92a2
extract Strategy Selector
germanurrus 0b94a23
update name of component
germanurrus 2250f3f
Merge branch 'cas-117' into cas-132
germanurrus 9f7d569
update step four
germanurrus e4feb62
remove strategy
germanurrus 31f1b4e
add validation to step four
germanurrus ffa75ac
Merge branch 'main' into cas-117
germanurrus 00c36a8
eslint updates
germanurrus ae67d9a
eslint fixes
germanurrus 6e30b7e
eslint fixes
germanurrus 6514986
update text
germanurrus c478a11
update saving data
germanurrus de5b22b
update updating strategies
germanurrus c78f504
remove moked data
germanurrus e29515a
updates to match backend changes
germanurrus 67b90fe
remove useEffect
germanurrus 0cd51f6
typo
germanurrus 64ea7f9
Merge branch 'cas-117' into cas-132
germanurrus 55e337f
fix reloading strategies
germanurrus e892b9e
use name from strategy
germanurrus 0e179d9
change name
germanurrus db7b170
Merge branch 'cas-117' into cas-132
germanurrus fbdb205
fix style and eslint
germanurrus 16fb9e0
Merge branch 'main' into cas-117
germanurrus f525a20
Merge branch 'cas-117' into cas-132
germanurrus c743f3a
update add strategy button
germanurrus 0bfaa72
fix dep
germanurrus 0d27df2
update onStrategySelection callback call
germanurrus d28e9ab
Merge branch 'main' into cas-117
germanurrus c37e184
Merge branch 'cas-117' into cas-132
germanurrus 020a157
Merge branch 'main' into cas-117
germanurrus ec9d9e3
add config for strategies
germanurrus 40a9368
update payload
germanurrus 6acbb9b
update mapping function
germanurrus 14e0929
remove output
germanurrus 38b8d6b
export and import helper function
germanurrus f68e726
Merge branch 'main' into cas-132
germanurrus aea0c1d
Merge branch 'cas-117' into cas-132
germanurrus 42cb55b
update data
germanurrus a749860
Merge branch 'main' into cas-132
germanurrus d2be9f4
remove map func
germanurrus 6e7dbc9
revert change removing wrapper
germanurrus 6e5ede9
extract validation
germanurrus a05e969
Merge branch 'main' into cas-132
germanurrus b1380fd
remove useEffect
germanurrus c40fab3
update if clause
germanurrus 110f465
remove dep
germanurrus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 11 additions & 5 deletions
16
frontend/packages/client/src/components/Community/StrategySelectorForm.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
frontend/packages/client/src/components/CommunityCreate/StepFour.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import React, { useEffect } from 'react'; | ||
| import StrategySelectorForm from 'components/Community/StrategySelectorForm'; | ||
| import ActionButton from 'components/ActionButton'; | ||
|
|
||
| export default function StepFour({ | ||
| stepData, | ||
| setStepValid, | ||
| onDataChange, | ||
| onSubmit, | ||
| isStepValid, | ||
| } = {}) { | ||
| const { strategies } = stepData || {}; | ||
|
|
||
| useEffect(() => { | ||
| if (strategies?.length > 0) { | ||
| setStepValid(true); | ||
| } else { | ||
| setStepValid(false); | ||
| } | ||
| }, [strategies, setStepValid]); | ||
|
|
||
| const onStrategySelection = (strategies) => { | ||
| onDataChange({ strategies }); | ||
| }; | ||
|
|
||
| return ( | ||
| <StrategySelectorForm | ||
| existingStrategies={strategies} | ||
| onStrategySelection={onStrategySelection} | ||
| callToAction={() => { | ||
| return ( | ||
| <ActionButton | ||
| label="CREATE COMMUNITY" | ||
| enabled={isStepValid} | ||
| onClick={isStepValid ? () => onSubmit() : () => {}} | ||
| classNames="mt-5" | ||
| /> | ||
| ); | ||
| }} | ||
| /> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated changes but this is not being used