mirror of
https://github.com/mue/mue.git
synced 2026-07-21 07:54:13 +02:00
7.x Structural Changes (#637)
* refactor(files): Initial commit on experimental file structure * refactor(structure): New components system * refactor(structure): Tidy settings' components * Refactor(structure): Component exports and imports * refactor(settings): Use new component imports * feat: unified background.js script * fix(build): Partially, distributions still not ready * feat: critical error on noscript, light theme support for it * fix(background): Critical issue of code making every background #000 * refactor(welcome): Partition into different files + shared components - This took too long and destroyed my sanity --------- Co-authored-by: alexsparkes <turbomarshmello@gmail.com> Co-authored-by: alexsparkes <alexsparkes@gmail.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { memo } from 'react';
|
||||
|
||||
function ProgressBar({ count, currentTab, switchTab }) {
|
||||
return (
|
||||
<div className="progressbar">
|
||||
{count.map((num) => {
|
||||
let className = 'step';
|
||||
|
||||
const index = count.indexOf(num);
|
||||
if (index === currentTab) {
|
||||
className = 'step active';
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className} key={index} onClick={() => switchTab(index)}>
|
||||
<span>{index + 1}</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const MemoizedProgressBar = memo(ProgressBar);
|
||||
|
||||
export default MemoizedProgressBar;
|
||||
export { MemoizedProgressBar as ProgressBar };
|
||||
@@ -0,0 +1 @@
|
||||
export * from './ProgressBar';
|
||||
@@ -0,0 +1 @@
|
||||
export * from './ProgressBar';
|
||||
12
src/features/modals/welcome/components/Layout/Header.jsx
Normal file
12
src/features/modals/welcome/components/Layout/Header.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
function Header({ title, subtitle }) {
|
||||
return (
|
||||
<>
|
||||
<span className="mainTitle">{title}</span>
|
||||
<span className="subtitle">
|
||||
{subtitle}
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export { Header as default, Header };
|
||||
7
src/features/modals/welcome/components/Layout/Layout.jsx
Normal file
7
src/features/modals/welcome/components/Layout/Layout.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
function Layout() {
|
||||
return (
|
||||
<h1>Cheese</h1>
|
||||
)
|
||||
}
|
||||
|
||||
export { Layout as default, Layout };
|
||||
5
src/features/modals/welcome/components/Layout/Panel.jsx
Normal file
5
src/features/modals/welcome/components/Layout/Panel.jsx
Normal file
@@ -0,0 +1,5 @@
|
||||
const Panel = ({ children, type }) => (
|
||||
<section> {type === 'content' ? <div className="content">{children}</div> : children}</section>
|
||||
);
|
||||
|
||||
export { Panel as default, Panel };
|
||||
@@ -0,0 +1,5 @@
|
||||
const Wrapper = ({ children }) => (
|
||||
<div className="welcomeContent">{children}</div>
|
||||
)
|
||||
|
||||
export { Wrapper as default, Wrapper };
|
||||
3
src/features/modals/welcome/components/Layout/index.jsx
Normal file
3
src/features/modals/welcome/components/Layout/index.jsx
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './Wrapper';
|
||||
export * from './Panel';
|
||||
export * from './Header';
|
||||
2
src/features/modals/welcome/components/index.jsx
Normal file
2
src/features/modals/welcome/components/index.jsx
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './Layout';
|
||||
export * from './Elements';
|
||||
Reference in New Issue
Block a user