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

This is my branch #8

Open
wants to merge 1 commit 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
43 changes: 43 additions & 0 deletions src/Alerts & notifications pushed/Alert.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useState } from "react";

const Alert = ({ variant }) => {
const [open, setOpen] = useState(true);

if (open)
return (
<div
className="alert-container"
style={{
background: variant.mainColor,
border: `0.1rem solid ${variant.secondaryColor}`,
}}
>
<div
className="symbol-container"
style={{ background: variant.secondaryColor }}
>
<span className="material-symbols-outlined symbol">
{variant.symbol}
</span>{" "}
</div>
<div className="description-container">
<span className="description-title" title={variant.title}>
{variant.title}:
</span>
<span className="description-text" title={variant.text}>
{variant.text}
</span>
</div>
<a
href="#"
className="symbol-close-link"
onClick={() => setOpen(false)}
>
<button className="material-symbols-outlined mystyle">Yes and continue</button>
</a>
</div>
);
else return null;
};

export default Alert;
15 changes: 15 additions & 0 deletions src/Alerts & notifications pushed/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import Alert from "./Alert";
import { variants } from "./variants";

function App() {
return (
<div className="">
{variants.map((variant, index) => (
<Alert key={index} variant={variant} />
))}
</div>
);
}

export default App;
43 changes: 43 additions & 0 deletions src/Alerts & notifications pushed/variants.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export const variants = [
// red
{
mainColor: "#FDEDED",
secondaryColor: "#F16360",
symbol: "Delete",
title: "Error",
text: "Attempted error!! Please try again.",
},
// blue
{
mainColor: "#E5F6FD",
secondaryColor: "#1AB1F5",
symbol: "Log",
title: "Information",
text: "Sign-in as Admin or as guest ",
},
// green
{
mainColor: "#EDFEEE",
secondaryColor: "#5CB660",
symbol: "Save",
title: "Success",
text: "Save assets in the stock",
},
// yellow
{
mainColor: "#FFF4E5",
secondaryColor: "#FFA117",
symbol: "Warn",
title: "Warning",
text: "Saving, please wait",
},
// pink
{
mainColor: "#FFC0CB",
secondaryColor: "#FF69B4",
symbol: "Good",
title: "Feedback",
text: " Congratulations stay tuned to binary Hub",
},
];

38 changes: 38 additions & 0 deletions src/Buttons-pushed/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// App.jsx
import React from "react";
import Button from "./Components/Buttons";

const App = () => {
return (
<React.Fragment>
<h1
style={{
textAlign: "center",
fontSize: "17px",
marginBottom: "20px",
}}
>
Some of Reusable Button Components
</h1>
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
flexWrap: "wrap",
gap: "10px",
}}
>
<Button variant="success">Save/Success Button</Button>
<Button variant="danger">Remove Button</Button>
<Button variant="warning">Warning/saving Button</Button>
<Button variant="primary"> Sign in Button</Button>
<Button variant="secondary">Stock Button</Button>
<Button variant="dark">Dark Button</Button>
<Button variant="light">Create Button</Button>
</div>
</React.Fragment>
);
};

export default App;
82 changes: 82 additions & 0 deletions src/Buttons-pushed/Components/Buttons.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Button.jsx

import React from 'react';
import styled from 'styled-components';

const ButtonComponent = styled.button`
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
text-align: center;
text-decoration: none;
vertical-align: middle;
cursor: pointer;
user-select: none;
border-radius: 9px;
padding: 0.3rem; /* Add the missing semicolon and adjust the value */
height: ${props =>
props.size === 'sm'
? '30px'
: props.size === 'md'
? '37px'
: props.size === 'lg'
? '40px'
: '34px'};
font-family: 'Inter', sans-serif;
font-weight: 500;
border: 1px solid transparent;
background-color: ${props =>
props.variant === 'light'
? '#FFF;'
: props.variant === 'dark'
? '#212529'
: props.variant === 'primary'
? '#2D90D2'
: props.variant === 'secondary'
? '#E8F1F8;'
: props.variant === 'success'
? '#00A524;'
: props.variant === 'info'
? '#0dcaf0'
: props.variant === 'warning'
? 'rgba(252, 191, 34, 1)'
: props.variant === 'danger'
? '#FFF'
: '#f8f9fa'}; /* Add # before f8f9fa */
color: ${props =>
props.variant === 'light'
? '#212529'
: props.variant === 'dark'
? '#ffffff'
: props.variant === 'primary'
? '#ffffff'
: props.variant === 'secondary'
? '#ffffff'
: props.variant === 'success'
? '#ffffff'
: props.variant === 'info'
? '#ffffff'
: props.variant === 'warning'
? '#ffffff'
: props.variant === 'danger'
? 'rgba(237, 0, 0, 1);'
: '#212529'};
`;

const Button = ({ type, variant, className, size, id, onClick, children }) => {
return (
<ButtonComponent
type={type ? type : 'button'}
className={className ? `btn-component ${className}` : 'btn-component'}
id={id}
onClick={onClick}
size={size}
variant={variant}
>
{children}
</ButtonComponent>
);
};

export default Button;
43 changes: 43 additions & 0 deletions src/Buttons-pushed/Components/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* styles.css */

.button {
padding: 10px 15px;
border: none;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
margin: 5px;
}

/* Button Styles */
.button.blue {
background-color: blue;
color: white;
}

.button.clear-white-blue {
background-color: #ffffff;
color: blue;
}

.button.white-with-border-blue {
background-color: #ffffff;
color: blue;
border: 2px solid blue;
}

.button.red {
background-color: red;
color: white;
}

.button.green {
background-color: green;
color: white;
}

.button.yellow {
background-color: yellow;
color: black;
}