mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2025-12-05 19:45:36 -05:00
add progress bar component and styling
This commit is contained in:
22
src/components/common/ProgressBar.tsx
Normal file
22
src/components/common/ProgressBar.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
interface ProgressBarProps {
|
||||
progress: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple progress bar component
|
||||
*/
|
||||
const ProgressBar = ({ progress }: ProgressBarProps) => {
|
||||
return (
|
||||
<div className="progress-container">
|
||||
<div className="progress-bar">
|
||||
<div
|
||||
className="progress-fill"
|
||||
style={{ width: `${Math.min(progress, 100)}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="progress-text">{Math.round(progress)}%</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ProgressBar
|
||||
@@ -1,2 +1,2 @@
|
||||
@forward './loading';
|
||||
@forward './updater';
|
||||
@forward './progress_bar';
|
||||
|
||||
39
src/styles/components/common/_progress_bar.scss
Normal file
39
src/styles/components/common/_progress_bar.scss
Normal file
@@ -0,0 +1,39 @@
|
||||
@use '../../themes/index' as *;
|
||||
@use '../../abstracts/index' as *;
|
||||
|
||||
/*
|
||||
Progress bar component styles
|
||||
*/
|
||||
|
||||
.progress-container {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
margin: 1.5rem auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: var(--border-dark);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background: var(--primary-color);
|
||||
transition: width 0.3s ease;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: var(--medium);
|
||||
}
|
||||
Reference in New Issue
Block a user