Skip to content

Commit 3934786

Browse files
committed
chore: update example default tab
1 parent b2438d2 commit 3934786

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/github-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: pnpm run build
4343

4444
- name: Build example
45-
run: cd examples/basic && pnpm run build --base=/html-diff/
45+
run: cd examples/basic && pnpm run build
4646

4747
- name: Upload artifact
4848
uses: actions/upload-pages-artifact@v3

examples/basic/src/App.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useDiffData from './hooks/useDiffData.js'
55
import useInputData from './hooks/useInputData.js'
66

77
function App() {
8-
const [tab, setTab] = useState(1)
8+
const [tab, setTab] = useState(2)
99
const { oldHtml, updateOldHtml, newHtml, updateNewHtml } = useInputData()
1010
const { unifiedContent, sideBySideContents } = useDiffData({ oldHtml, newHtml })
1111

examples/basic/src/components/SideBySide.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ export default function SideBySide({ sideBySideContents }) {
1414
let isRightScroll = false
1515
function handleScroll(type) {
1616
if (type === 'left') {
17-
if (isRightScroll.current) return
17+
if (isRightScroll) return
1818
isLeftScroll = true
1919
clearTimeout(timer)
2020
timer = setTimeout(() => {
2121
isLeftScroll = false
2222
}, 300)
2323
syncScroll(leftContainer.current, rightContainer.current)
2424
} else {
25-
if (isLeftScroll.current) return
25+
if (isLeftScroll) return
2626
isRightScroll = true
2727
clearTimeout(timer)
2828
timer = setTimeout(() => {

examples/basic/vite.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { defineConfig } from 'vite'
21
import react from '@vitejs/plugin-react'
2+
import { defineConfig } from 'vite'
33

44
// https://vite.dev/config/
55
export default defineConfig({
6+
base: '/html-diff/',
67
plugins: [react()],
78
})

0 commit comments

Comments
 (0)