Skip to content

Commit 1b23123

Browse files
Alpana176kishanrathorshreya-mishra325aliviahossainaliviahossain
authored
Pop up - Added username check and alerts for frame, shape, canvas, and theme buttons (#138)
* AOS Animations added * Done necessary modifications. (#70) Co-authored-by: aliviahossain <[email protected]> * Update dependencies. * Update package.json * Update pnpm-lock.yaml * feat(avatar): Implement conditional frame overlay and transparent background (#72) * Deployment * Add username check and alerts to frame, shape, canvas, and theme buttons --------- Co-authored-by: kishan <[email protected]> Co-authored-by: Shreya Mishra <[email protected]> Co-authored-by: Alivia Hossain <[email protected]> Co-authored-by: aliviahossain <[email protected]> Co-authored-by: $ῗἧḡḥ@sḥmⓔⓔṫ <[email protected]> Co-authored-by: Dhara Pandya <[email protected]> Co-authored-by: ashmeet07 <[email protected]>
1 parent 50ba369 commit 1b23123

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

api/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,4 +1505,4 @@ app.listen(PORT, () => {
15051505
console.log(` GET /api/smart-frame/:username - AI-powered smart frame suggestions`);
15061506
console.log(` GET /api/badge/:username - Generate GitHub stats badges`);
15071507
console.log(` GET /api/health - Health check`);
1508-
});
1508+
});

client/src/App.jsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,15 @@ function App() {
383383
});
384384
}, []);
385385
const [username, setUsername] = useState("");
386+
// helper to show alert if username missing; returns true if blocked
387+
const blockIfNoUsername = () => {
388+
if (!username || !username.trim()) {
389+
alert("Hey! Please enter your GitHub username first 😊");
390+
return true; // blocked
391+
}
392+
return false; // ok
393+
};
394+
386395
const [themes, setThemes] = useState([]);
387396
const [selectedTheme, setSelectedTheme] = useState("base");
388397
const [customAccentColor, setCustomAccentColor] = useState(null);
@@ -1439,6 +1448,54 @@ function App() {
14391448
</button>
14401449
</div>
14411450
</div>
1451+
{/* Frame Style Control Group(Border Focus) */}
1452+
<div style={{marginBottom: "24px"}}>
1453+
<label
1454+
style={{
1455+
display: "block",
1456+
fontSize: "14px",
1457+
fontWeight: "600",
1458+
color: colors.textPrimary,
1459+
marginBottom: "8px",
1460+
}}>
1461+
Frame Style (Param : `style`)
1462+
</label>
1463+
<div style={{maxWidth: "fit-content"}}>
1464+
<div
1465+
className='control-button-set'
1466+
style={{display: "flex", gap: "12px"}}>
1467+
<ControlButton
1468+
onClick={() => {
1469+
if(blockIfNoUsername()){
1470+
alert("please enter a username first!");
1471+
return;
1472+
}
1473+
setFrameStyle("default");
1474+
alert("Default frame selected!");
1475+
}}
1476+
isSelected={frameStyle === "default"}
1477+
isDark={isDark}
1478+
>
1479+
Default
1480+
</ControlButton>
1481+
<ControlButton
1482+
onClick={() => {
1483+
if(blockIfNoUsername()){
1484+
alert("please enter the user name first!");
1485+
return;
1486+
}
1487+
setFrameStyle("border-focus");
1488+
alert("border-focus frame selected!");
1489+
1490+
}}
1491+
isSelected={frameStyle === "border-focus"}
1492+
isDark={isDark}
1493+
>
1494+
Border Focus
1495+
</ControlButton>
1496+
</div>
1497+
</div>
1498+
</div>
14421499

14431500
{/* Control Group: Canvas & Shape */}
14441501
<div

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dependencies": {
1515
"aos": "^2.3.4",
1616
"axios": "^1.12.2",
17+
"aos":"^2.3.4",
1718
"cors": "^2.8.5",
1819
"express": "^4.21.2",
1920
"sharp": "^0.34.4",

0 commit comments

Comments
 (0)