Skip to content

Rohanjadhav - fixes #3083 #3142

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

Merged
merged 7 commits into from
Jun 5, 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
14 changes: 8 additions & 6 deletions client/components/PreviewNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ const PreviewNav = ({ owner, project }) => {
<nav className="nav preview-nav">
<div className="nav__items-left">
<div className="nav__item-logo">
<LogoIcon
role="img"
aria-label={t('Common.p5logoARIA')}
focusable="false"
className="svg__logo"
/>
<Link to={`/${owner.username}/sketches`}>
<LogoIcon
role="img"
aria-label={t('Common.p5logoARIA')}
focusable="false"
className="svg__logo"
/>
</Link>
</div>
<Link
className="nav__item"
Expand Down
27 changes: 20 additions & 7 deletions client/modules/IDE/components/Header/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const ProjectMenu = () => {
const isUserOwner = useSelector(getIsUserOwner);
const project = useSelector((state) => state.project);
const user = useSelector((state) => state.user);

const userSketches = `${user.username}/sketches`;
const isUnsaved = !project?.id;

const rootFile = useSelector(selectRootFile);
Expand All @@ -137,12 +137,25 @@ const ProjectMenu = () => {
return (
<ul className="nav__items-left">
<li className="nav__item-logo">
<LogoIcon
role="img"
aria-label={t('Common.p5logoARIA')}
focusable="false"
className="svg__logo"
/>
{user && user.username !== undefined ? (
<Link to={userSketches}>
<LogoIcon
role="img"
aria-label={t('Common.p5logoARIA')}
focusable="false"
className="svg__logo"
/>
</Link>
) : (
<a href="https://p5js.org">
<LogoIcon
role="img"
aria-label={t('Common.p5logoARIA')}
focusable="false"
className="svg__logo"
/>
</a>
)}
</li>
<NavDropdownMenu id="file" title={t('Nav.File.Title')}>
<NavMenuItem onClick={newSketch}>{t('Nav.File.New')}</NavMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,16 @@ exports[`Nav renders editor version for desktop 1`] = `
<li
class="nav__item-logo"
>
<test-file-stub
aria-label="p5.js Logo"
classname="svg__logo"
focusable="false"
role="img"
/>
<a
href="https://p5js.org"
>
<test-file-stub
aria-label="p5.js Logo"
classname="svg__logo"
focusable="false"
role="img"
/>
</a>
</li>
<li
class="nav__item"
Expand Down
Loading