This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 #206 from blueedgetechno/test
Dark Mode and much more ...
- Loading branch information
Showing
56 changed files
with
1,617 additions
and
1,158 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
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.
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 not shown.
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.
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.
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.
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,96 +1,101 @@ | ||
import React, {useState, useEffect} from 'react'; | ||
import {useSelector, useDispatch} from 'react-redux'; | ||
import {Icon} from '../../utils/general'; | ||
import './menu.scss'; | ||
import React, { useState, useEffect } from "react"; | ||
import { useSelector, useDispatch } from "react-redux"; | ||
import { Icon } from "../../utils/general"; | ||
import "./menu.scss"; | ||
|
||
import * as Actions from '../../actions'; | ||
import * as Actions from "../../actions"; | ||
|
||
export const ActMenu = ()=>{ | ||
const menu = useSelector(state=>state.menus); | ||
const {abpos, isLeft} = useSelector(state=>{ | ||
export const ActMenu = () => { | ||
const menu = useSelector((state) => state.menus); | ||
const { abpos, isLeft } = useSelector((state) => { | ||
var acount = state.menus.menus[state.menus.opts].length; | ||
var tmpos = { | ||
'top': state.menus.top, | ||
'left': state.menus.left | ||
}, tmpleft = false; | ||
top: state.menus.top, | ||
left: state.menus.left, | ||
}, | ||
tmpleft = false; | ||
|
||
var wnwidth = window.innerWidth, | ||
wnheight = window.innerHeight; | ||
wnheight = window.innerHeight; | ||
|
||
var ewidth = 312, | ||
eheight = acount*28; | ||
eheight = acount * 28; | ||
|
||
tmpleft = (wnwidth - tmpos.left) > 504; | ||
if(wnwidth - tmpos.left < ewidth){ | ||
tmpos.right = wnwidth - tmpos.left; | ||
tmpos.left = null; | ||
tmpleft = wnwidth - tmpos.left > 504; | ||
if (wnwidth - tmpos.left < ewidth) { | ||
tmpos.left = wnwidth - ewidth; | ||
} | ||
|
||
if(wnheight - tmpos.top < eheight){ | ||
if (wnheight - tmpos.top < eheight) { | ||
tmpos.bottom = wnheight - tmpos.top; | ||
tmpos.top = null; | ||
} | ||
|
||
return { | ||
abpos: tmpos, | ||
isLeft: tmpleft | ||
isLeft: tmpleft, | ||
}; | ||
}) | ||
}); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
const clickDispatch = (event)=>{ | ||
const clickDispatch = (event) => { | ||
event.stopPropagation(); | ||
var action = { | ||
type: event.target.dataset.action, | ||
payload: event.target.dataset.payload | ||
payload: event.target.dataset.payload, | ||
}; | ||
|
||
if(action.type){ | ||
if(action.type!=action.type.toUpperCase()){ | ||
Actions[action.type](action.payload,menu); | ||
}else{ | ||
if (action.type) { | ||
if (action.type != action.type.toUpperCase()) { | ||
Actions[action.type](action.payload, menu); | ||
} else { | ||
dispatch(action); | ||
} | ||
dispatch({type: "MENUHIDE"}); | ||
dispatch({ type: "MENUHIDE" }); | ||
} | ||
} | ||
}; | ||
|
||
const menuobj = (data)=>{ | ||
const menuobj = (data) => { | ||
var mnode = []; | ||
data.map(opt=>{ | ||
if(opt.type=="hr"){ | ||
data.map((opt) => { | ||
if (opt.type == "hr") { | ||
mnode.push(<div className="menuhr"></div>); | ||
}else{ | ||
mnode.push(<div className="menuopt" data-dsb={opt.dsb} | ||
onClick={clickDispatch} data-action={opt.action} | ||
data-payload={opt.payload}> | ||
{opt.name} | ||
{opt.icon?<Icon src={opt.icon} width={14}/>:null} | ||
{opt.opts?<Icon fafa="faChevronRight" width={10} color="#999"/>:null} | ||
{opt.dot?<Icon className="dotIcon" fafa="faCircle" width={4} | ||
height={4} color="#333"/>:null} | ||
{opt.check?<Icon className="checkIcon" fafa="faCheck" width={8} | ||
height={8} color="#333"/>:null} | ||
{opt.opts?( | ||
<div className="minimenu"> | ||
{menuobj(opt.opts)} | ||
} else { | ||
mnode.push( | ||
<div className="menuopt" data-dsb={opt.dsb} onClick={clickDispatch} data-action={opt.action} data-payload={opt.payload}> | ||
<div className="spcont"> | ||
{opt.icon && opt.type=="svg" ? <Icon icon={opt.icon} width={16} /> : null} | ||
{opt.icon && opt.type=="fa" ? <Icon fafa={opt.icon} width={16} /> : null} | ||
{opt.icon && opt.type==null ? <Icon src={opt.icon} width={16} /> : null} | ||
</div> | ||
):null} | ||
</div>) | ||
<div className="nopt">{opt.name}</div> | ||
{opt.opts ? <Icon className="micon rightIcon" fafa="faChevronRight" width={10} color="#999" /> : null} | ||
{opt.dot ? <Icon className="micon dotIcon" fafa="faCircle" width={4} height={4} /> : null} | ||
{opt.check ? <Icon className="micon checkIcon" fafa="faCheck" width={8} height={8} /> : null} | ||
{opt.opts ? <div className="minimenu">{menuobj(opt.opts)}</div> : null} | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
return mnode; | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="actmenu" id="actmenu" style={{ | ||
...abpos, | ||
'--prefix':'MENU'}} data-hide={menu.hide} data-left={isLeft}> | ||
<div | ||
className="actmenu" | ||
id="actmenu" | ||
style={{ | ||
...abpos, | ||
"--prefix": "MENU", | ||
}} | ||
data-hide={menu.hide} | ||
data-left={isLeft} | ||
> | ||
{menuobj(menu.menus[menu.opts])} | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default ActMenu; |
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
Oops, something went wrong.