mirror of
https://github.com/pawelmalak/snippet-box.git
synced 2025-12-21 13:23:05 +01:00
Changed some components classes to use new theme
This commit is contained in:
@@ -26,8 +26,7 @@
|
|||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject"
|
||||||
"postbuild": "purgecss --css build/static/css/*.css --content build/index.html build/static/js/*.js --output build/static/css"
|
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const SnippetCard = (props: Props): JSX.Element => {
|
|||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
text='View'
|
text='View'
|
||||||
color='dark'
|
color='secondary'
|
||||||
small
|
small
|
||||||
outline
|
outline
|
||||||
classes='me-2'
|
classes='me-2'
|
||||||
@@ -60,7 +60,12 @@ export const SnippetCard = (props: Props): JSX.Element => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
<Button text='Copy code' color='dark' small handler={copyHandler} />
|
<Button
|
||||||
|
text='Copy code'
|
||||||
|
color='secondary'
|
||||||
|
small
|
||||||
|
handler={copyHandler}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const SnippetCode = (props: Props): JSX.Element => {
|
|||||||
<textarea
|
<textarea
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='code'
|
id='code'
|
||||||
rows={13}
|
rows={16}
|
||||||
value={props.code}
|
value={props.code}
|
||||||
disabled
|
disabled
|
||||||
></textarea>
|
></textarea>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export const SnippetDetails = (props: Props): JSX.Element => {
|
|||||||
<div>
|
<div>
|
||||||
{tags.map((tag, idx) => (
|
{tags.map((tag, idx) => (
|
||||||
<span className='me-2' key={idx}>
|
<span className='me-2' key={idx}>
|
||||||
<Badge text={tag} color='dark' />
|
<Badge text={tag} color='light' />
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -76,7 +76,7 @@ export const SnippetDetails = (props: Props): JSX.Element => {
|
|||||||
<div className='d-grid g-2' style={{ rowGap: '10px' }}>
|
<div className='d-grid g-2' style={{ rowGap: '10px' }}>
|
||||||
<Button
|
<Button
|
||||||
text='Edit'
|
text='Edit'
|
||||||
color='dark'
|
color='secondary'
|
||||||
small
|
small
|
||||||
outline
|
outline
|
||||||
handler={() => {
|
handler={() => {
|
||||||
@@ -94,7 +94,12 @@ export const SnippetDetails = (props: Props): JSX.Element => {
|
|||||||
outline
|
outline
|
||||||
handler={() => deleteSnippet(id)}
|
handler={() => deleteSnippet(id)}
|
||||||
/>
|
/>
|
||||||
<Button text='Copy code' color='dark' small handler={copyHandler} />
|
<Button
|
||||||
|
text='Copy code'
|
||||||
|
color='secondary'
|
||||||
|
small
|
||||||
|
handler={copyHandler}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export const SnippetForm = (props: Props): JSX.Element => {
|
|||||||
<div className='d-grid'>
|
<div className='d-grid'>
|
||||||
<Button
|
<Button
|
||||||
text={`${inEdit ? 'Update snippet' : 'Create snippet'}`}
|
text={`${inEdit ? 'Update snippet' : 'Create snippet'}`}
|
||||||
color='dark'
|
color='secondary'
|
||||||
type='submit'
|
type='submit'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ export const SnippetPin = (props: Props): JSX.Element => {
|
|||||||
return (
|
return (
|
||||||
<div onClick={() => toggleSnippetPin(id)} className='cursor-pointer'>
|
<div onClick={() => toggleSnippetPin(id)} className='cursor-pointer'>
|
||||||
{isPinned ? (
|
{isPinned ? (
|
||||||
<Icon path={mdiPin} size={0.8} color='#212529' />
|
<Icon path={mdiPin} size={0.8} color='#20c997' />
|
||||||
) : (
|
) : (
|
||||||
<Icon path={mdiPinOutline} size={0.8} color='#9a9a9a' />
|
<Icon path={mdiPinOutline} size={0.8} color='#ced4da' />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import { Link } from 'react-router-dom';
|
|||||||
|
|
||||||
export const EmptyState = (): JSX.Element => {
|
export const EmptyState = (): JSX.Element => {
|
||||||
const editorLink = (
|
const editorLink = (
|
||||||
<Link to='/editor' className='fw-bold text-decoration-none text-dark'>
|
<Link to='/editor' className='fw-bold text-success text-decoration-none'>
|
||||||
<span>editor</span>
|
<span>editor</span>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='col-12 d-flex flex-column align-items-center'>
|
<div className='col-12 d-flex flex-column align-items-center'>
|
||||||
<h4 className='text-muted'>You currently don't have any snippets</h4>
|
<h4>You currently don't have any snippets</h4>
|
||||||
<p>Go to the {editorLink} and create one</p>
|
<p>Go to the {editorLink} and create one</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ interface Props {
|
|||||||
export const Layout = (props: Props): JSX.Element => {
|
export const Layout = (props: Props): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<div className='container-lg px-5'>
|
<div className='container-lg px-5'>
|
||||||
<div className='row pt-4'>{props.children}</div>
|
<div className='row py-4'>{props.children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const PageHeader = <T,>(props: Props<T>): JSX.Element => {
|
|||||||
pathname: prevDest,
|
pathname: prevDest,
|
||||||
state: prevState
|
state: prevState
|
||||||
}}
|
}}
|
||||||
className='text-decoration-none text-dark'
|
className='text-decoration-none text-light'
|
||||||
>
|
>
|
||||||
<- Go back
|
<- Go back
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const Home = (): JSX.Element => {
|
|||||||
{snippets.some(s => s.isPinned) && (
|
{snippets.some(s => s.isPinned) && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<PageHeader title='Pinned snippets' />
|
<PageHeader title='Pinned snippets' />
|
||||||
<div className='col-12 mb-3'>
|
<div className='col-12 mt-3'>
|
||||||
<SnippetGrid snippets={snippets.filter(s => s.isPinned)} />
|
<SnippetGrid snippets={snippets.filter(s => s.isPinned)} />
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ export const Snippets = (): JSX.Element => {
|
|||||||
<span>Total</span>
|
<span>Total</span>
|
||||||
<span>{snippets.length}</span>
|
<span>{snippets.length}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
|
|
||||||
<h5 className='card-title'>Filter by tags</h5>
|
<h5 className='card-title'>Filter by tags</h5>
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{tagCount.map((tag, idx) => {
|
{tagCount.map((tag, idx) => {
|
||||||
@@ -53,7 +55,7 @@ export const Snippets = (): JSX.Element => {
|
|||||||
<div
|
<div
|
||||||
key={idx}
|
key={idx}
|
||||||
className={`d-flex justify-content-between cursor-pointer ${
|
className={`d-flex justify-content-between cursor-pointer ${
|
||||||
isActiveFilter && 'text-dark fw-bold'
|
isActiveFilter && 'text-success'
|
||||||
}`}
|
}`}
|
||||||
onClick={() => filterHandler(tag.name)}
|
onClick={() => filterHandler(tag.name)}
|
||||||
>
|
>
|
||||||
@@ -66,7 +68,7 @@ export const Snippets = (): JSX.Element => {
|
|||||||
<div className='d-grid mt-3'>
|
<div className='d-grid mt-3'>
|
||||||
<Button
|
<Button
|
||||||
text='Clear filters'
|
text='Clear filters'
|
||||||
color='dark'
|
color='secondary'
|
||||||
small
|
small
|
||||||
outline
|
outline
|
||||||
handler={clearFilterHandler}
|
handler={clearFilterHandler}
|
||||||
|
|||||||
Reference in New Issue
Block a user