fix: truncate file title (#6)

This commit is contained in:
Thuc Pham
2024-10-22 15:24:04 +07:00
committed by GitHub
parent 1cfd198b4e
commit 8cc45b800c
6 changed files with 84 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
+47
View File
@@ -0,0 +1,47 @@
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn --immutable
- name: Get changeset status
id: get-changeset-status
run: |
yarn changeset status --output .changeset/status.json
new_version=$(jq -r '.releases[0].newVersion' < .changeset/status.json)
rm -v .changeset/status.json
echo "new-version=${new_version}" >> "$GITHUB_OUTPUT"
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: Release ${{ steps.get-changeset-status.outputs.new-version }}
title: Release ${{ steps.get-changeset-status.outputs.new-version }}
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+19
View File
@@ -87,6 +87,25 @@ To fix this issue, you need to use dynamic imports for the PDF component (to ind
+ );
```
## Contributing
When making changes to this project, please follow these steps:
1. Make your code changes
2. Create a changeset to document your changes:
```bash
yarn changeset
```
3. Commit your changes and the changeset
4. When ready to release a new version:
```bash
yarn new-version
```
5. To publish the new version:
```bash
yarn release
```
## 🙏 Thanks
Thanks to the developers of the following dependencies that we're using:
+6 -1
View File
@@ -31,7 +31,11 @@
"prepack": "yarn clean && yarn build",
"test": "yarn lint && yarn tsc && yarn format",
"tsc": "tsc",
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\""
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\"",
"new-snapshot": "yarn build && changeset version --snapshot",
"new-version": "yarn build && changeset version",
"release": "yarn build && changeset publish",
"release-snapshot": "yarn build && changeset publish --tag snapshot"
},
"dependencies": {
"@wojtekmaj/react-hooks": "1.17.2",
@@ -44,6 +48,7 @@
"react-window": "1.8.9"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@types/lodash": "^4.14.195",
"@types/lodash.debounce": "^4.0.7",
"@types/node": "*",
+1 -1
View File
@@ -61,7 +61,7 @@ const PDFOptionsBar: React.FC<PDFOptionsBarProps> = ({
return (
<div className="optionBar">
<div className="title">File ID: {file.id}</div>
<div className="title truncate">File ID: {file.id}</div>
<div className="control">
<div className="pageControl">
<button className="pageUp" onClick={prevPage} disabled={scrolledIndex === 0}>
-3
View File
@@ -23,9 +23,6 @@
padding-left: 8px;
margin-left: 8px;
border-right: 1px solid lightslategray;
display: flex;
align-items: center;
height: 100%;
}
.pdf-viewer-container .optionBar .control {