Skip to content
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

Rework repo for managing multiple themes #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# React + TypeScript + Vite

## Installation

`npm install`

## Create a theme

`npm run create-theme`

## Run dev theme

`npm run dev:<theme name>`

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:
Expand Down
165 changes: 165 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "chat-theme",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"create-theme": "npx ts-node --skip-project src/utils/create-theme.ts",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"prepare": "husky install",
"prettier": "prettier --write ."
"prettier": "prettier --write .",
"dev:gummybear": "cd src/themes/gummybear && npx vite",
"dev:example": "cd src/themes/example && npx vite"
},
"dependencies": {
"chance": "^1.1.11",
Expand All @@ -20,6 +21,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@types/chance": "^1.1.6",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.10.0",
Expand All @@ -31,6 +33,7 @@
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"vite": "^5.0.0"
},
Expand Down
20 changes: 0 additions & 20 deletions src/app.tsx

This file was deleted.

20 changes: 20 additions & 0 deletions src/components/Settings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'

export function Settings() {
return (
<div className="settings">
<label htmlFor="dark-mode" className="theme-toggle">
<input
type="checkbox"
id="dark-mode"
onChange={(event) =>
window.dispatchEvent(
new CustomEvent('dark-mode', { detail: event.target.checked })
)
}
/>
Dark Mode
</label>
</div>
)
}
35 changes: 0 additions & 35 deletions src/components/chat-demo.tsx

This file was deleted.

Loading