Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
feat: Opening of corresponding apps upon clicking. (#805)
Browse files Browse the repository at this point in the history
* feat: Opening of corresponding apps upon clicking.

* fix: Closing of window when app is opened.
  • Loading branch information
git-init-priyanshu authored Oct 7, 2023
1 parent 6689e29 commit 2fb7a6a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/components/start/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,29 @@ export const BandPane = () => {
style={{ "--prefix": "BAND" }}
>
<div className="bandContainer">
<Icon className="hvlight" src="defender" width={17} />
<Icon className="hvlight" src="spotify" width={17} />
<Icon className="hvlight" src="teams" width={17} />
<Icon
className="hvlight"
width={17}
click="CALCUAPP"
payload="togg"
open="true"
src="calculator"
/>
<Icon
className="hvlight"
width={17}
click="SPOTIFY"
payload="togg"
open="true"
src="spotify"
/>
<Icon
className="hvlight"
width={17}
click="NOTEPAD"
payload="togg"
src="notepad"
/>
</div>
</div>
);
Expand Down Expand Up @@ -128,7 +148,7 @@ export const SidePane = () => {
function sliderBackground(elem, e) {
elem.style.setProperty(
"--track-color",
`linear-gradient(90deg, var(--clrPrm) ${e - 3}%, #888888 ${e}%)`,
`linear-gradient(90deg, var(--clrPrm) ${e - 3}%, #888888 ${e}%)`
);
}

Expand Down
4 changes: 4 additions & 0 deletions src/utils/general.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ String.prototype.count = function (c) {
};

export const Icon = (props) => {
const sidepane = useSelector((state) => state.sidepane);

const dispatch = useDispatch();
var src = `img/icon/${props.ui != null ? "ui/" : ""}${props.src}.png`;
if (props.ext != null || (props.src && props.src.includes("http"))) {
Expand All @@ -38,6 +40,8 @@ export const Icon = (props) => {
}

const clickDispatch = (event) => {
if (!sidepane.banhide) dispatch({ type: "BANDHIDE" });

var action = {
type: event.currentTarget.dataset.action,
payload: event.currentTarget.dataset.payload,
Expand Down

0 comments on commit 2fb7a6a

Please sign in to comment.