-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1422 from qdraw/feature/202403-docs-29
Feature/202403 docs 29
- Loading branch information
Showing
34 changed files
with
412 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+106 KB
documentation/docs/assets/getting-started-first-steps-manual-sync-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.4 KB
documentation/docs/assets/getting-started-first-steps-manual-sync.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+116 KB
documentation/docs/assets/getting-started-first-steps-storage-folder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": { | ||
"editor.codeActionsOnSave": { | ||
"folders": [ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit", | ||
"source.fixAll": "explicit", | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.formatOnPaste": true, | ||
"editor.tabSize": 2, | ||
"editor.detectIndentation": false, | ||
"editor.insertSpaces": true, | ||
"html.format.wrapLineLength": 100, | ||
"html.format.wrapAttributes": "force-aligned", | ||
"html.format.contentUnformatted": "pre,code,textarea, span", | ||
"html.format.endWithNewline": true, | ||
"javascript.preferences.quoteStyle": "double", | ||
"javascript.updateImportsOnFileMove.enabled": "always", | ||
"jest.disabledWorkspaceFolders": [ | ||
"node_modules", | ||
"mock", | ||
"history.md" | ||
], | ||
"typescript.preferences.quoteStyle": "double", | ||
"typescript.updateImportsOnFileMove.enabled": "always", | ||
"typescript.tsdk": "clientapp/node_modules/typescript/lib", | ||
"editor.formatOnSave": true, | ||
} | ||
} | ||
"editor.formatOnPaste": true, | ||
"editor.tabSize": 2, | ||
"editor.detectIndentation": false, | ||
"editor.insertSpaces": true, | ||
"html.format.wrapLineLength": 100, | ||
"html.format.wrapAttributes": "force-aligned", | ||
"html.format.contentUnformatted": "pre,code,textarea, span", | ||
"html.format.endWithNewline": true, | ||
"javascript.preferences.quoteStyle": "double", | ||
"javascript.updateImportsOnFileMove.enabled": "always", | ||
"jest.disabledWorkspaceFolders": ["node_modules", "mock", "history.md"], | ||
"typescript.preferences.quoteStyle": "double", | ||
"typescript.updateImportsOnFileMove.enabled": "always", | ||
"typescript.tsdk": "clientapp/node_modules/typescript/lib", | ||
"editor.formatOnSave": true, | ||
"testing.openTesting": "neverOpen" | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
starsky/starsky/clientapp/src/components/atoms/tooltip/tooltip.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { fireEvent, render, screen } from "@testing-library/react"; | ||
import Tooltip from "./tooltip"; | ||
|
||
describe("Tooltip component", () => { | ||
it("renders tooltip text on hover", () => { | ||
const text = "This is a tooltip"; | ||
const component = render( | ||
<Tooltip text={text} left={false}> | ||
Hover me | ||
</Tooltip> | ||
); | ||
|
||
// Tooltip should not be visible initially | ||
expect(screen.queryByTestId("tooltip")).toBeFalsy(); | ||
|
||
// Hover over the button to display the tooltip | ||
fireEvent.mouseEnter(screen.getByText("Hover me")); | ||
|
||
// Tooltip should now be visible | ||
expect(screen.getByTestId("tooltip")).toBeTruthy(); | ||
expect(screen.getByText(text)).toBeTruthy(); | ||
|
||
// Move mouse away to hide the tooltip | ||
fireEvent.mouseLeave(screen.getByText("Hover me")); | ||
expect(screen.queryByTestId("tooltip")).toBeFalsy(); | ||
component.unmount(); | ||
}); | ||
|
||
describe("click behavior", () => { | ||
it("renders tooltip text on click", () => { | ||
const text = "This is a tooltip"; | ||
const component = render( | ||
<Tooltip text={text} left={false}> | ||
Click me | ||
</Tooltip> | ||
); | ||
|
||
const test = component.container.innerHTML; | ||
console.log(test); | ||
|
||
// Tooltip should not be visible initially | ||
expect(screen.queryByTestId("tooltip")).toBeFalsy(); | ||
|
||
// Click on the button to display the tooltip | ||
fireEvent.click(screen.getByText("Click me")); | ||
|
||
// Tooltip should now be visible | ||
expect(screen.queryByTestId("tooltip")).toBeTruthy(); | ||
expect(screen.getByText(text)).toBeTruthy(); | ||
|
||
// Click on the button again to hide the tooltip | ||
fireEvent.click(screen.getByText("Click me")); | ||
|
||
expect(screen.queryByTestId("tooltip")).toBeFalsy(); | ||
|
||
component.unmount(); | ||
}); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
starsky/starsky/clientapp/src/components/atoms/tooltip/tooltip.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Tooltip from "./tooltip"; | ||
|
||
export default { | ||
title: "components/atoms/tooltip" | ||
}; | ||
|
||
export const Default = () => { | ||
return ( | ||
<> | ||
<br /> | ||
<div style={{ padding: 50 }}> | ||
<Tooltip left={true} text="Comma seperated info"> | ||
<span className="info--small"></span> | ||
</Tooltip> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
Default.storyName = "default"; |
37 changes: 37 additions & 0 deletions
37
starsky/starsky/clientapp/src/components/atoms/tooltip/tooltip.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { useState } from "react"; | ||
|
||
interface TooltipProps { | ||
text: string; | ||
children?: React.ReactNode; | ||
left: boolean; | ||
} | ||
|
||
const Tooltip: React.FC<TooltipProps> = ({ text, children, left }) => { | ||
const [showTooltip, setShowTooltip] = useState(false); | ||
|
||
const handleMouseEnter = () => { | ||
setShowTooltip((prevState) => !prevState); | ||
}; | ||
|
||
const handleMouseLeave = () => { | ||
setShowTooltip(false); | ||
}; | ||
|
||
return ( | ||
<button | ||
className={left ? "tooltip-container left" : "tooltip-container"} | ||
onMouseEnter={handleMouseEnter} | ||
onClick={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
{children} | ||
{showTooltip && ( | ||
<span data-test="tooltip" className="tooltip"> | ||
{text} | ||
</span> | ||
)} | ||
</button> | ||
); | ||
}; | ||
|
||
export default Tooltip; |
Oops, something went wrong.
3ec8c1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://starskyapp.netlify.app as production
🚀 Deployed on https://65e0de11a881b51c9f953607--starskyapp.netlify.app