Skip to content

Commit

Permalink
fix: add version checker'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruceo committed Jun 28, 2024
1 parent 60efee6 commit b8fa47a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 29 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"pg-hstore": "^2.3.4",
"sequelize": "^6.35.2"
},
"version": "0.30.0",
"version": "0.29.5",
"devDependencies": {
"@eslint/js": "^9.1.1",
"eslint": "^9.1.1",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "compra-simples-frontend",
"private": true,
"version": "0.29.3",
"version": "0.29.5",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/Layout/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ export default function Bar() {
}
else setIsOpenDropDown(false)
}
const [newVersionDisponible, setNewVersionDisponible] = useState(false)

useEffect(() => {
fetch("https://raw.githubusercontent.com/Kruceo/easyfish/main/frontend/package.json").then((res) => res.json()
.then(data => {
if (data.version != pkg.version) setNewVersionDisponible(true)
}))
}, [])

useEffect(() => {
window.addEventListener('click', clickHandler)
Expand Down Expand Up @@ -48,7 +56,7 @@ export default function Bar() {
<p className="capitalize font-bold text-current">{user}</p>
</div>
<div className="mx-4 pb-4 flex">
<p className="opacity-30 cursor-default">{pkg.version}</p>
<p title={newVersionDisponible?"Nova versão disponível":"Versão"} className={`opacity-30 cursor-default ${newVersionDisponible?"line-through":""}`}>{pkg.version}</p>
<Link to={"/login"} onClick={() => Cookies.set("token", "undefined")} title="Sair" className="w-fit ml-auto flex items-center justify-end gap-2 text-red-500">
Sair{/* <i>&#xea14;</i> */}
</Link>
Expand Down
52 changes: 26 additions & 26 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ var myTheme = {
},
colors: {
// DARK
// toolbar: "#151515",
// bar: "#131313",
// sidebar: "#151515",
// subpanel: "#171717",
// submit: "#56f",
// "submit-text": "#222",
// notification: "#202020",
// background: "#171717",
// "default-text": "#c0c0c0",
// borders: "#262626",
// hovers: "#222",
// selected: "#224"
toolbar: "#151515",
bar: "#131313",
sidebar: "#151515",
subpanel: "#171717",
submit: "#56f",
"submit-text": "#222",
notification: "#202020",
background: "#171717",
"default-text": "#c0c0c0",
borders: "#262626",
hovers: "#222",
selected: "#224"

// LIGHT
bar: "#dfe4f9",
sidebar: "#eef0f7",
toolbar: "#f2f4fb",
headers: "#f2f4fb",
subpanel: "#fcfcfc",
submit: "#f2f4fb",
"submit-text": "#535584",
notification: "#f2f4fb",
background: "#fcfcfc",
"default-text": "#535584",
borders: "#ccc8",
hovers: "#ccf",
selected: "#aaf"
// bar: "#dfe4f9",
// sidebar: "#eef0f7",
// toolbar: "#f2f4fb",
// headers: "#f2f4fb",
// subpanel: "#fcfcfc",
// submit: "#f2f4fb",
// "submit-text": "#535584",
// notification: "#f2f4fb",
// background: "#fcfcfc",
// "default-text": "#535584",
// borders: "#ccc8",
// hovers: "#ccf",
// selected: "#aaf"
},
borderWidth: {
"default": 0,
Expand All @@ -50,7 +50,7 @@ var myTheme = {
},
borderRadius: {
"default": 0,
"panel-default": 0,
"panel-default": 5,
"input-default": 5,
"button-default": 3
},
Expand Down

0 comments on commit b8fa47a

Please sign in to comment.