adding tooltips to home buttons

fixinganerror
lianahus 1 year ago
parent a8a3112146
commit cd31f6d7c6
  1. 2
      apps/remix-ide/src/app/tabs/locales/en/home.json
  2. 1
      apps/remix-ide/src/app/tabs/locales/es/home.json
  3. 1
      apps/remix-ide/src/app/tabs/locales/fr/home.json
  4. 2
      apps/remix-ide/src/app/tabs/locales/zh/home.json
  5. 31
      libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx

@ -57,7 +57,9 @@
"home.files": "Files", "home.files": "Files",
"home.newFile": "New File", "home.newFile": "New File",
"home.startCoding": "Start Coding", "home.startCoding": "Start Coding",
"home.startCodingPlayground": "Open a playground for prototyping and simply learning",
"home.openFile": "Open File", "home.openFile": "Open File",
"home.openFileTooltip": "Open a File from you File System",
"home.accessFileSystem": "Access File System", "home.accessFileSystem": "Access File System",
"home.loadFrom": "Load from", "home.loadFrom": "Load from",
"home.resources": "Resources", "home.resources": "Resources",

@ -55,6 +55,7 @@
"home.files": "Files", "home.files": "Files",
"home.newFile": "New File", "home.newFile": "New File",
"home.openFile": "Open File", "home.openFile": "Open File",
"home.openFileTooltip": "Open a File from you File System",
"home.connectToLocalhost": "Access File System", "home.connectToLocalhost": "Access File System",
"home.loadFrom": "Load from", "home.loadFrom": "Load from",
"home.resources": "Resources" "home.resources": "Resources"

@ -55,6 +55,7 @@
"home.files": "Files", "home.files": "Files",
"home.newFile": "New File", "home.newFile": "New File",
"home.openFile": "Open File", "home.openFile": "Open File",
"home.openFileTooltip": "Open a File from you File System",
"home.connectToLocalhost": "Access File System", "home.connectToLocalhost": "Access File System",
"home.loadFrom": "Load from", "home.loadFrom": "Load from",
"home.resources": "Resources" "home.resources": "Resources"

@ -55,7 +55,9 @@
"home.files": "文件", "home.files": "文件",
"home.newFile": "新建文件", "home.newFile": "新建文件",
"home.startCoding": "Start Coding", "home.startCoding": "Start Coding",
"home.startCodingPlayground": "Open a playground for prototyping and simply learning",
"home.openFile": "打开本地文件", "home.openFile": "打开本地文件",
"home.openFileTooltip": "Open a File from you File System",
"home.connectToLocalhost": "连接本地主机", "home.connectToLocalhost": "连接本地主机",
"home.loadFrom": "从以下来源导入", "home.loadFrom": "从以下来源导入",
"home.resources": "资源" "home.resources": "资源"

@ -244,40 +244,33 @@ function HomeTabFile({ plugin }: HomeTabFileProps) {
</label> </label>
<div className="d-flex flex-column"> <div className="d-flex flex-column">
<div className="d-flex flex-row"> <div className="d-flex flex-row">
<CustomTooltip
placement={'top'}
tooltipId="overlay-tooltip"
tooltipClasses="text-nowrap"
tooltipText={<FormattedMessage id='home.startCodingPlayground' />}
tooltipTextClasses="border bg-light text-dark p-1 pr-3"
>
<button className="btn btn-primary text-nowrap p-2 mr-2 border my-1" data-id="homeTabStartCoding" style={{ width: 'fit-content' }} onClick={() => startCoding()}> <button className="btn btn-primary text-nowrap p-2 mr-2 border my-1" data-id="homeTabStartCoding" style={{ width: 'fit-content' }} onClick={() => startCoding()}>
<FormattedMessage id="home.startCoding" /> <FormattedMessage id="home.startCoding" />
</button> </button>
<label className="btn text-nowrap p-2 mr-2 border my-1" style={{ width: 'fit-content', cursor: 'pointer' }} htmlFor="openFileInput"> </CustomTooltip>
<FormattedMessage id="home.openFile" />
</label>
<input
title="open file"
type="file"
id="openFileInput"
onChange={(event) => {
event.stopPropagation()
plugin.verticalIcons.select('filePanel')
uploadFile(event.target)
}}
multiple
/>
<CustomTooltip <CustomTooltip
placement={'top'} placement={'top'}
tooltipId="overlay-tooltip" tooltipId="overlay-tooltip"
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
tooltipText={<FormattedMessage id='home.openFile' />} tooltipText={<FormattedMessage id='home.openFileTooltip' />}
tooltipTextClasses="border bg-light text-dark p-1 pr-3" tooltipTextClasses="border bg-light text-dark p-1 pr-3"
> >
<span> <span>
<label className="btn p-2 mr-2 border my-1" style={{width: 'fit-content', cursor: 'pointer'}} htmlFor="openFileInput"> <label className="btn text-nowrap p-2 mr-2 border my-1" style={{ width: 'fit-content', cursor: 'pointer' }} htmlFor="openFileInput">
<FormattedMessage id='home.openFile' /> <FormattedMessage id="home.openFile" />
</label> </label>
<input <input
title="open file" title="open file"
type="file" type="file"
id="openFileInput" id="openFileInput"
onChange={ onChange={(event) => {
(event) => {
event.stopPropagation() event.stopPropagation()
plugin.verticalIcons.select('filePanel') plugin.verticalIcons.select('filePanel')
uploadFile(event.target) uploadFile(event.target)

Loading…
Cancel
Save