Skip to content
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
34 changes: 23 additions & 11 deletions client/modules/IDE/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,31 @@ export default function SideBar() {
{t('Sidebar.AddFile')}
</button>
</li>
{isAuthenticated && (
<li>
<button
aria-label={t('Sidebar.UploadFileARIA')}
onClick={() => {
<li>
<button
className={classNames(
!isAuthenticated && 'tooltipped-no-delay',
!isAuthenticated && 'tooltipped',
!isAuthenticated && 'tooltipped-s'
)}
aria-label={
!isAuthenticated
? t('Sidebar.UploadFileTooltip')
: t('Sidebar.UploadFileARIA')
}
disabled={!isAuthenticated}
onClick={() => {
if (!isAuthenticated) {
window.location.href = '/login';
} else {
dispatch(openUploadFileModal(rootFile.id));
setTimeout(() => dispatch(closeProjectOptions()), 300);
}}
>
{t('Sidebar.UploadFile')}
</button>
</li>
)}
}
}}
>
{t('Sidebar.UploadFile')}
</button>
</li>
</ul>
)}
</div>
Expand Down
12 changes: 12 additions & 0 deletions client/styles/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,16 @@
.sidebar--project-options & {
display: flex;
}
& button:disabled {
@include themify() {
opacity: 0.5;
cursor: not-allowed;
}
&:hover {
@include themify() {
background-color: transparent;
color: getThemifyVariable('primary-text-color');
}
}
}
}
3 changes: 2 additions & 1 deletion translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@
"AddFile": "Create file",
"AddFileARIA": "add file",
"UploadFile": "Upload file",
"UploadFileARIA": "upload file"
"UploadFileARIA": "upload file",
"UploadFileTooltip": "Log in to upload file"
},
"FileNode": {
"OpenFolderARIA": "Open folder contents",
Expand Down