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

Added share feature #89

Merged
merged 2 commits into from
Oct 12, 2024
Merged
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
36 changes: 19 additions & 17 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
"react-phone-input-2": "^2.15.1",
"react-phone-number-input": "^3.3.10",
"react-router-dom": "^6.22.3",
"react-toastify": "^10.0.5",
"react-toggle": "^4.1.3",
"react-top-loading-bar": "^2.3.1",
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"sort-by": "^1.2.0",
"sort-by": "^0.0.2",
"yup": "^1.4.0"
},
"devDependencies": {
Expand Down
18 changes: 4 additions & 14 deletions client/src/component/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './css/Home.css'
import PropTypes from 'prop-types';
import HeroImg from '../assets/images/Vector Gif/Hero.gif'
import Learn from '../assets/images/Learn.png'
import Share from '../assets/images/Share.png'
import ShareComponent from './Share';
import Grow from '../assets/images/Grow.png'
import glichBitboxGif from '../assets/images/Other Gifs/Bitbox Glitch.gif'
import CardsPage from './HomePage/Card';
Expand Down Expand Up @@ -71,19 +71,9 @@ const Home = (props) => {
</div>
</div>
</div>
<div className="container my-5">
<div className="row">
<div className="col-lg-6">
<img className="w-100 rounded-5" src={Share} />
</div>
<div className="col-lg-6">
<div className="p-5 mt-4">
<h1 className="display-4" style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}>Share</h1>
<p className="lead" style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}>🌐 Join the vibrant Bitbox Opensource Community today! Whether you&apos;re a seasoned developer or just starting out, there&apos;s a place for you to collaborate, innovate, and make a difference. Let&apos;s shape the future of digital exchange together! #BitboxCommunity #OpenSource 🚀💻 </p>
<a href="#" className="btn btn-outline-dark" style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}>Read More</a>
</div>
</div>
</div>
<div style={{color:'black'}}>

<ShareComponent/>
</div>
</div>
</section>
Expand Down
59 changes: 59 additions & 0 deletions client/src/component/Share.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import Share from '../assets/images/Share.png';

const ShareComponent = (props) => {
const handleShareClick = () => {
const shareLink = window.location.href;
navigator.clipboard.writeText(shareLink).then(() => {
toast.success('Link copied to clipboard!', {
position: 'top-right',
autoClose: 3000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
style: {
backgroundColor: '#fff', // White background
color: '#000', // Force black text color
fontWeight: 'bold', // Optional: Make the text bold for better visibility
},
progressStyle: {
backgroundColor: '#000', // Black progress bar
},
});
});
};

return (
<div className="container my-5">
<div className="row">
<div className="col-lg-6">
<img className="w-100 rounded-5" src={Share} alt="Share" />
</div>
<div className="col-lg-6">
<div className="p-5 mt-4">
<h1 className="display-4" style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}>
Share
</h1>
<p className="lead" style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}>
🌐 Join the vibrant Bitbox Opensource Community today! Whether you're a seasoned developer or just starting out, there's a place for you to collaborate,
innovate, and make a difference. Let's shape the future of digital exchange together! #BitboxCommunity #OpenSource 🚀💻
</p>
<button
onClick={handleShareClick}
className="btn btn-outline-dark"
style={{ background: props.mode === 'dark' ? 'black' : 'white', color: props.mode === 'dark' ? 'white' : 'black' }}
>
Share Now
</button>
</div>
</div>
</div>
<ToastContainer />
</div>
);
};

export default ShareComponent;
5 changes: 5 additions & 0 deletions client/src/component/share.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.toast-body-black-text {
color: #000 !important; /* Force the toast body text color to black */
background-color: #fff !important; /* Ensure white background */
}

Loading