Skip to content

CAS-154 - add My Communities section to homepage#97

Merged
dbslone merged 23 commits intomainfrom
cas-154
Jul 8, 2022
Merged

CAS-154 - add My Communities section to homepage#97
dbslone merged 23 commits intomainfrom
cas-154

Conversation

@germanurrus
Copy link
Copy Markdown
Contributor

@germanurrus germanurrus commented Jul 5, 2022

Home page updates:

Screen Shot 2022-07-05 at 17 45 11

  • Added react-query
  • Remove redux dependencies not used
  • Moved some dependencies to dev dependencies

There's only one issue that will be addressed in another PR:

  1. User clicks on join in a community in the home page from the feature communities section
  2. If the "My Communities" section was not visible it should appear with the community the user has just joined. Same if the user leaves the community and that was the only one, the "My Communities" section should fade out

@germanurrus germanurrus self-assigned this Jul 5, 2022
$body-background-color: white
$primary: $yellow
$spacing-values: ("0": 0, "1": 0.25rem, "2": 0.5rem, "3": 0.75rem, "4": 1rem, "5": 1.5rem, "6": 3rem, "7": 4.5rem,"8": 6rem, "9": 9rem, "auto": auto) !default

Copy link
Copy Markdown
Contributor Author

@germanurrus germanurrus Jul 5, 2022

Choose a reason for hiding this comment

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

This will enable us do use classNames with *-7, *-8 or *-9 instead of using the style prop of the component. Bulma comes with *-6 as max. https://bulma.io/documentation/helpers/spacing-helpers/

Comment on lines -33 to -41
"redux": "^4.1.0",
"redux-persist": "^6.0.0",
"redux-persist-cookie-storage": "^1.0.0",
"redux-thunk": "^2.3.0",
"sass": "^1.49.8",
"string-strip-html": "8.3.0",
"prettier": "^2.7.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"react-redux": "^7.2.4", => removed 
"redux": "^4.1.0", => removed 
"redux-persist": "^6.0.0",  => removed 
"redux-persist-cookie-storage": "^1.0.0",  => removed 
"redux-thunk": "^2.3.0",  => removed 
"sass": "^1.49.8",  => moved to dev dependencies, only used at build time 
"prettier": "^2.7.1",  => moved to dev dependencies
"eslint-config-prettier": "^8.5.0"  => moved to dev dependencies https://github.com/prettier/eslint-config-prettier#installation
"eslint-plugin-prettier": "^4.0.0"  => moved to dev dependencies https://github.com/prettier/eslint-plugin-prettier#installation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@germanurrus prettier and the eslint config have to be here otherwise the staging build breaks because of how monorepos work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added deps back and left out redux

Comment thread frontend/packages/client/src/App.js Outdated
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: process.env.NODE_ENV !== 'development',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the default for this configuration is true seems to me too hard and resource consuming to use it on dev mode reloading every we switch seems: visual studio code <=> browser.
On prod or staging it's on with this code. Looks like a nice feature to keep the page updated, any suggestions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can keep the refetch on development as well. Our local machines are more powerful than staging/prod and unless new data is returned then no additional page renders occur.

@germanurrus germanurrus marked this pull request as ready for review July 6, 2022 15:37
@germanurrus germanurrus changed the title feat(frontend): add My Communities section to homepage cas-154 - add My Communities section to homepage Jul 6, 2022
@germanurrus germanurrus changed the title cas-154 - add My Communities section to homepage CAS-154 - add My Communities section to homepage Jul 6, 2022
@germanurrus germanurrus requested a review from jbluks July 7, 2022 21:16
Comment on lines -33 to -41
"redux": "^4.1.0",
"redux-persist": "^6.0.0",
"redux-persist-cookie-storage": "^1.0.0",
"redux-thunk": "^2.3.0",
"sass": "^1.49.8",
"string-strip-html": "8.3.0",
"prettier": "^2.7.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@germanurrus prettier and the eslint config have to be here otherwise the staging build breaks because of how monorepos work

Comment on lines +36 to +38
data:
data?.pages?.reduce((prev, current) => [...prev, ...current.data], []) ??
[],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's possible for the API to return null on communities-for-homepage endpoint. To prevent errors maybe we should do something like:

data: data?.pages?.reduce((prev, current) => {
      return current.data ? [...prev, ...current.data] : prev;
    }, []),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread frontend/packages/client/src/App.js Outdated
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: process.env.NODE_ENV !== 'development',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can keep the refetch on development as well. Our local machines are more powerful than staging/prod and unless new data is returned then no additional page renders occur.

@dbslone
Copy link
Copy Markdown
Contributor

dbslone commented Jul 7, 2022

@germanurrus I'm unable to create a community when I visit /community/create the screen hangs on the loading screen

import { QueryClient, QueryClientProvider } from 'react-query';

// create react-query client
const queryClient = new QueryClient();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

default comes with refetchOnWindowFocus: true,

Copy link
Copy Markdown
Collaborator

@jbluks jbluks left a comment

Choose a reason for hiding this comment

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

LGTM

@dbslone dbslone merged commit 8c43255 into main Jul 8, 2022
@dbslone dbslone deleted the cas-154 branch July 8, 2022 22:10
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