Skip to content

Commit

Permalink
beast backup
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Oct 11, 2023
1 parent 01b3974 commit c395437
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 6 deletions.
57 changes: 51 additions & 6 deletions src/lib/common/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,56 @@ export enum Mode {
LIGHT = 'light',
DARK = 'dark',
}
// TODO: this can go in CSS variables in global styles.

const theme = createTheme({
palette: {
primary: {
main: '#f44336',
},
const palette = {
mode: Mode.LIGHT,
primary: {
main: '#f44336',
},
})
secondary: {
main: '#3f51b5',
},
tertiary: {
main: '#fff',
},
neutral: {
main: '#000',
},
neutralVariant: {
main: '#fff',
},
}

const darkPalette = {
mode: Mode.DARK,
primary: {
main: '#f44336',
},
secondary: {
main: '#3f51b5',
},
tertiary: {
main: '#fff',
},
neutral: {
main: '#000',
},
neutralVariant: {
main: '#fff',
},
}

export const generateTheme = (mode: Mode) => {
return createTheme({
palette: mode === Mode.DARK ? darkPalette : palette,
})
}

// const theme = createTheme({
// palette: {
// primary: {
// main: '#f44336',
// },
// },
// })
1 change: 1 addition & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config: Config = {
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
// TODO: adjust screen breakpoints, phone, tablet, laptop, desktop, projector
theme: {
extend: {
backgroundImage: {
Expand Down
24 changes: 24 additions & 0 deletions tools/create-feature-branch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if [[ $# -ne 2 ]] ; then
echo 'usage: tools/create-feature-branch <ticketnumber> <branchname>'
echo
echo 'examples: tools/create-feature-branch 1234 fancyfeature'
echo ' tools/create-feature-branch 1234 "my fancy feature"'
exit 1
fi

echo "Fetching upstream"
git fetch upstream --progress

echo "Switching to main"
git checkout upstream/main -B main
if [ $? != 0 ]; then
echo "Can't reset and checkout main"
exit 1
fi

echo "Creating feature branch from main"
git checkout -b feature-$1-${2//[^a-zA-Z0-9]/_} main

echo "Done"
47 changes: 47 additions & 0 deletions tools/deploy-to-gh-pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# install deps & project build done
# control comes here only if install and build goes fine
# assumes 'docs' to be present in the main branch
# assumes 'gh-pages' branch is present

# set GitHub config credentials

git config user.email "[email protected]"
git config user.name "deployment-bot"

# remove any changes by stashing
# checkout to main

git stash
git checkout main

# checkout to the gh-pages, reset
# sync the branch with our main

git checkout gh-pages
git reset --hard origin/main

# delete everything on the directory
# ignore the docs folder

find * -maxdepth 0 -not -name 'storybook-static' -exec rm -rf '{}' ';'

# remove some folders additionally

rm -rf .husky .storybook

# move the docs folder content
# explode in the repository root

mv ./storybook-static/* .

# deletes the git cache
# push the new content to gh-pages

git rm -rf --cache .
git add .
git commit -m "Deploy Storybook to GitHub pages"

# force push to origin/gh-pages
git push origin gh-pages --force

0 comments on commit c395437

Please sign in to comment.