Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Possible to make changing logos and titles a config? #21

Open
jmagly opened this issue Feb 1, 2022 · 8 comments
Open

Possible to make changing logos and titles a config? #21

jmagly opened this issue Feb 1, 2022 · 8 comments

Comments

@jmagly
Copy link

jmagly commented Feb 1, 2022

Mirror providers are going to always be a thing, branding may be something that people have varying opinions on, regardless of these its best to make branding name metadata a configuration rather than hard code.

What would it take to get such a config in place?

@melMass
Copy link

melMass commented Feb 1, 2022

What would it take to get such a config in place?

While looking into the rotatin logos ideas with @SlinkousArt yesterday, I realised that we use create-react app which relies on react-scripts, AFAIK we cannot further edit the webpack config without ejecting (this basicaly extracts all the config files from react-scripts, not something we want I think)

One solution that I've used successfully in the past was using Craco.
This would allow us to inject anything in the webpack config and one could do:

import dark_logos from "./logos/dark/*.png"

@melMass
Copy link

melMass commented Feb 1, 2022

Re-reading the question I think I misinterpreted it, you mean a way for forks to easily apply their branding?

@jmagly
Copy link
Author

jmagly commented Feb 1, 2022

Im ok with the configuration being something injected for the build, I dont think its necessarily a requirement for us to make it 100% easy to do at runtime, any mirror will likely be doing a build.

@jmagly
Copy link
Author

jmagly commented Feb 1, 2022

correct, if the concern is a mirror running a deployment appearing to be of one site or another being able to change the branding is a must for anyone running a mirror so its clear the user is on a mirror

@xat
Copy link

xat commented Feb 1, 2022

this could be done with the help of environment variables. create-react-app replaces environment variables in the frontend code if they are prefixed with REACT_APP_.

see https://create-react-app.dev/docs/adding-custom-environment-variables/

@xat
Copy link

xat commented Feb 1, 2022

although if we are talking about multiple things that can be configured, a config file might be the better option.

@melMass
Copy link

melMass commented Feb 1, 2022

this could be done with the help of environment variables. create-react-app replaces environment variables in the frontend code if they are prefixed with REACT_APP_.

Great so we could have:

REACT_APP_FORK_NAME = teia
REACT_APP_FORK_DESCRIPTION = The Eternal Institute of Art
REACT_APP_FORK_URL = https://teia.art
REACT_APP_FORK_TWITTER = @teia_community
REACT_APP_FORK_LOGO = teia_logo.png # so we assume it's in the root of public

Not sure if it covers everyting

@jmagly
Copy link
Author

jmagly commented Feb 1, 2022

ENV vars during build should be perfectly acceptable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants