Skip to content

Commit 47bc37a

Browse files
author
Zaydek Michels-Gualtieri
committed
Renamed tooltip dependencies
1 parent 310e6d6 commit 47bc37a

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

src/EditorApp/EditorApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import usePreferences from "./usePreferences"
1010

1111
import {
1212
Editor,
13-
useEditor,
13+
useEditor
1414
} from "Editor"
1515

1616
const App = () => {

src/EditorApp/MemoFixedBottomWYSIWYGMenu/WYSIWYGMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import DispatchContext from "../DispatchContext"
22
import React from "react"
33
import userAgent from "lib/Client/userAgent"
4-
import { AbsoluteTopTooltip as Tooltip } from "../Tooltips"
4+
import { TopTooltip as Tooltip } from "../Tooltips"
55

66
const WYSIWYGMenu = ({ rangeTypes }) => {
77
const dispatch = React.useContext(DispatchContext)

src/EditorApp/MemoFixedTopPreferences/MemoFixedTopPreferences.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import React from "react"
44
import Releases from "./Releases"
55
import tabSize from "lib/x/tabSize"
66
import Transition from "lib/x/Transition"
7-
import { AbsoluteBottomLeftToolTip as LeftTooltip } from "../Tooltips"
8-
import { AbsoluteBottomRightToolTip as RightTooltip } from "../Tooltips"
7+
8+
import {
9+
BottomLHSTooltip,
10+
BottomRHSTooltip,
11+
} from "../Tooltips"
912

1013
const MemoFixedTopPreferences = React.memo(({ prefs }) => {
1114
const dispatch = React.useContext(PrefsDispatchContext)
@@ -35,11 +38,11 @@ const MemoFixedTopPreferences = React.memo(({ prefs }) => {
3538
}}
3639
>
3740
{(!prefs.show && tooltip === "lock") && (
38-
<LeftTooltip>
41+
<BottomLHSTooltip>
3942
<p className="text-xs whitespace-pre text-gray-100">
4043
{!prefs.readOnlyMode ? "Enable Read-Only Mode" : "Disable Read-Only Mode"}
4144
</p>
42-
</LeftTooltip>
45+
</BottomLHSTooltip>
4346
)}
4447
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
4548
{!prefs.readOnlyMode
@@ -68,11 +71,11 @@ const MemoFixedTopPreferences = React.memo(({ prefs }) => {
6871
}}
6972
>
7073
{(!prefs.show && tooltip === "releases") && (
71-
<RightTooltip>
74+
<BottomRHSTooltip>
7275
<p className="text-xs whitespace-pre text-gray-100">
7376
View Releases
7477
</p>
75-
</RightTooltip>
78+
</BottomRHSTooltip>
7679
)}
7780
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
7881
<path d="M18 3a1 1 0 00-1.447-.894L8.763 6H5a3 3 0 000 6h.28l1.771 5.316A1 1 0 008 18h1a1 1 0 001-1v-4.382l6.553 3.276A1 1 0 0018 15V3z" clipRule="evenodd" fillRule="evenodd" />
@@ -93,11 +96,11 @@ const MemoFixedTopPreferences = React.memo(({ prefs }) => {
9396
}}
9497
>
9598
{(!prefs.show && tooltip === "markdown") && (
96-
<RightTooltip>
99+
<BottomRHSTooltip>
97100
<p className="text-xs whitespace-pre text-gray-100">
98101
Render to GitHub Flavored Markdown
99102
</p>
100-
</RightTooltip>
103+
</BottomRHSTooltip>
101104
)}
102105
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
103106
<path d="M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm3.293 1.293a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 01-1.414-1.414L7.586 10 5.293 7.707a1 1 0 010-1.414zM11 12a1 1 0 100 2h3a1 1 0 100-2h-3z" clipRule="evenodd" fillRule="evenodd" />
@@ -118,11 +121,11 @@ const MemoFixedTopPreferences = React.memo(({ prefs }) => {
118121
}}
119122
>
120123
{(!prefs.show && tooltip === "markup") && (
121-
<RightTooltip>
124+
<BottomRHSTooltip>
122125
<p className="text-xs whitespace-pre text-gray-100">
123126
Render to HTML
124127
</p>
125-
</RightTooltip>
128+
</BottomRHSTooltip>
126129
)}
127130
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
128131
<path d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z" clipRule="evenodd" fillRule="evenodd" />

src/EditorApp/Tooltips.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22

3-
export const AbsoluteTopTooltip = ({ children }) => (
3+
export const TopTooltip = ({ children }) => (
44
<div className="absolute bottom-full" style={{ left: "50%" }}>
55
<div className="px-2 py-1 relative bg-gray-800 rounded shadow" style={{ left: "-50%" }}>
66
<div className="absolute bottom-0 inset-x-0 flex flex-row justify-center">
@@ -11,7 +11,7 @@ export const AbsoluteTopTooltip = ({ children }) => (
1111
</div>
1212
)
1313

14-
export const AbsoluteBottomLeftToolTip = ({ children }) => (
14+
export const BottomLHSTooltip = ({ children }) => (
1515
<div className="absolute top-full left-0">
1616
<div className="px-2 py-1 bg-gray-800 rounded shadow">
1717
<div className="absolute top-0 left-0">
@@ -22,7 +22,7 @@ export const AbsoluteBottomLeftToolTip = ({ children }) => (
2222
</div>
2323
)
2424

25-
export const AbsoluteBottomRightToolTip = ({ children }) => (
25+
export const BottomRHSTooltip = ({ children }) => (
2626
<div className="absolute top-full right-0">
2727
<div className="px-2 py-1 bg-gray-800 rounded shadow">
2828
<div className="absolute top-0 right-0">

0 commit comments

Comments
 (0)