16 KiB
Electron React Boilerplate uses Electron, React, React Router, Webpack and React Fast Refresh.
Install
Clone the repo and install dependencies:
git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name
cd your-project-name
npm install
Having issues installing? See our debugging guide
Starting Development
Start the app in the dev environment:
npm start
Packaging for Production
To package apps for the local platform:
npm run package
Docs
See our docs and guides here
Community
Join our Discord: https://discord.gg/Fjy3vfgy5q
Sponsors
Donations
Donations will ensure the following:
- 🔨 Long term maintenance of the project
- 🛣 Progress on the roadmap
- 🐛 Quick responses to bug reports and help requests
Backers
Support us with a monthly donation and help us continue our activities. [Become a backer]
Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]
Maintainers
License
MIT © Electron React Boilerplate
Для использования CustomNotification:
IMPORTS
import CustomNotification from '../components/Notifications/CustomNotification'; import type { NotificationPosition } from '../components/Notifications/CustomNotification'; import { getNotificationPosition } from '../utils/settings';
STATE
const [notifOpen, setNotifOpen] = useState(false); const [notifMsg, setNotifMsg] = useState<React.ReactNode>(''); const [notifSeverity, setNotifSeverity] = useState< 'success' | 'info' | 'warning' | 'error'
('info');
const [notifPos, setNotifPos] = useState({ vertical: 'bottom', horizontal: 'center', });
ВМЕСТО setNotification
setNotifMsg('Ошибка при загрузке прокачки!'); // string setNotifSeverity('error'); // 'success' || 'info' || 'warning' || 'error' setNotifPos(getNotificationPosition()); // top || bottom & center || right || left setNotifOpen(true); // Не изменять
СРАЗУ ПОСЛЕ ПЕРВОГО
<CustomNotification open={notifOpen} message={notifMsg} severity={notifSeverity} position={notifPos} onClose={() => setNotifOpen(false)} autoHideDuration={2500} />