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

Tab titles #4368

Merged
merged 5 commits into from
Oct 13, 2023
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
12 changes: 10 additions & 2 deletions editor/src/components/filebrowser/filebrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,20 @@ export const FileBrowser = React.memo(() => {
setAddingFile({ fileOrFolder: fileOrFolder, filename: '' })
}, [])

const projectName = useEditorState(
Substores.restOfEditor,
(store) => {
return store.editor.projectName
},
'TitleBar projectName',
)

return (
<>
<Section data-name='FileBrowser' onFocus={onFocus} tabIndex={-1}>
<SectionTitleRow minimised={minimised} toggleMinimised={toggleMinimised}>
<FlexRow flexGrow={1} style={{ position: 'relative' }}>
<Title>Project</Title>
<span>(root)</span>
<FileBrowserActionSheet
visible={!minimised}
setAddingFileOrFolder={setAddingFileOrFolder}
Expand Down Expand Up @@ -386,7 +394,7 @@ const FileBrowserActionSheet = React.memo((props: FileBrowserActionSheetProps) =
return (
<ActionSheet>
<SquareButton highlight onClick={addFolderClick}>
<Icons.NewFolder tooltipText='Add New Folder' />
<Icons.GroupClosed tooltipText='Add New Folder' />
</SquareButton>
<SquareButton highlight onClick={addTextFileClick}>
<Icons.NewTextFile tooltipText='Add Code File' />
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/filebrowser/fileitem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ class FileBrowserItemInner extends React.PureComponent<
) : null}
{displayAddFolder ? (
<Button onClick={this.showAddingFolderRow}>
<Icons.NewFolder style={fileIconStyle} tooltipText='Add New Folder' />
<Icons.GroupClosed style={fileIconStyle} tooltipText='Add New Folder' />
</Button>
) : null}
{displayAddTextFile ? (
Expand Down
19 changes: 1 addition & 18 deletions editor/src/components/navigator/insert-menu-pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
/** @jsxFrag React.Fragment */
import { jsx } from '@emotion/react'
import React from 'react'
import { NO_OP } from '../../core/shared/utils'
import {
Button,
FlexRow,
Icons,
Section,
SectionBodyArea,
SectionTitleRow,
Title,
} from '../../uuiui'
import { Section, SectionBodyArea } from '../../uuiui'
import { setFocus } from '../common/actions'
import type { EditorDispatch, LoginState } from '../editor/action-types'
import { InsertMenu } from '../editor/insertmenu'
Expand Down Expand Up @@ -61,14 +52,6 @@ export const InsertMenuPane = React.memo(() => {
tabIndex={-1}
style={{ width: '100%', height: '100%' }}
>
<SectionTitleRow minimised={false} toggleMinimised={NO_OP} hideButton={true}>
<FlexRow flexGrow={1} style={{ position: 'relative' }}>
<Title>Insert</Title>
</FlexRow>
<Button highlight style={{ width: 22, height: 22 }}>
<Icons.Cross onMouseDown={onClickClose} onClick={onClickClose} />
</Button>
</SectionTitleRow>
<SectionBodyArea minimised={false} style={{ height: '100%' }}>
<InsertMenu />
</SectionBodyArea>
Expand Down
32 changes: 15 additions & 17 deletions editor/src/components/navigator/left-pane/github-pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1120,24 +1120,22 @@ export const GithubPane = React.memo(() => {
<div style={{ height: '100%', overflowY: 'scroll' }}>
<Section>
<SectionTitleRow minimised={false} hideButton>
<FlexRow flexGrow={1}>
<Title style={{ flexGrow: 1 }}>Github</Title>
<FlexRow>
<MenuIcons.Octocat style={{ width: 19, height: 19 }} />
{githubUser != null ? (
<Button
style={{ gap: 4, padding: '0 6px' }}
onClick={openGithubProfile}
css={{
'&:hover': {
opacity: 0.6,
},
}}
>
@{githubUser?.login}
</Button>
) : null}
</FlexRow>
{when(
githubUser != null,
<Button
style={{ gap: 4, padding: '0 6px' }}
onClick={openGithubProfile}
css={{
'&:hover': {
opacity: 0.6,
},
}}
>
@{githubUser?.login}
{<MenuIcons.Octocat style={{ width: 19, height: 19 }} />}
</Button>,
)}
</SectionTitleRow>
{unless(
isLoggedIn,
Expand Down
9 changes: 0 additions & 9 deletions editor/src/components/navigator/left-pane/settings-pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,7 @@ export const SettingsPane = React.memo(() => {
}}
>
<Section>
<UIGridRow
style={{ color: colorTheme.fg1.value }}
padded
variant='<---1fr--->|------172px-------|'
>
<H2> Project </H2>
</UIGridRow>

{isMyProject === 'yes' ? null : <ForksGiven />}

<UIGridRow padded variant='<---1fr--->|------172px-------|'>
<span style={{ color: colorTheme.fg2.value }}>Name</span>
{userState.loginState.type !== 'LOGGED_IN' ? (
Expand Down
8 changes: 7 additions & 1 deletion editor/src/uuiui/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,15 @@ export const Icons = {
color: 'main',
category: 'layout/flex',
}),

Downloaded: makeIcon({ type: 'downloaded', color: 'main', width: 18, height: 18 }),
Gear: makeIcon({ type: 'gear', color: 'main' }),
GroupClosed: makeIcon({
type: 'group-closed',
category: 'element',
color: 'main',
width: 18,
height: 18,
}),
Threedots: makeIcon({ type: 'threedots', color: 'main' }),
LinkClosed: makeIcon({ type: 'link-closed', color: 'main' }),
LinkStrikethrough: makeIcon({ type: 'link-strikethrough', color: 'main' }),
Expand Down
Loading