Commit c803a76a authored by mxm-web-develop's avatar mxm-web-develop

321

parent da5e090a
......@@ -47,7 +47,6 @@ export const EventsScrollView = (props: ScrollViewType) => {
BScroll.use(NestedScroll);
const { wrapHeight, children } = props;
const wrapRef = useRef<HTMLDivElement>(null);
const [dots,setDots]= useState(0)
const [scrollObj, setScrollObj] = useState<BScrollConstructor<{}>>();
const [currentPage,setCurrentPage] = useState(0)
......
......@@ -68,10 +68,7 @@ const HoverLink = () =>{
export default function Navbar (props: IAppProps) {
const {pathname} = useLocation()
const {data} = React.useContext(AppContext)
React.useEffect(()=>{
console.log(22222);
},[data.theme])
return (
<nav className='flex min-w-[1440px] justify-between absolute px-[120px] w-full top-0 z-[99999] py-6 text-sm text-[#061E3B] font-normal '>
<div className='left '>
......@@ -84,6 +81,8 @@ export default function Navbar (props: IAppProps) {
<Link to='news' className={`hover:text-theme-blue ${pathname ==='/news'?' text-theme-dark content-sub2-title-cn py-0' :'text-[#061E3B] font-normal'}`}>新闻动态</Link>
{/* <Link to='classes' className={`hover: text-theme-dark ${pathname ==='/classes'?' text-theme-dark':'text-[#061E3B] font-normal'}`}>公开课</Link> */}
<Link to='about' className={`hover:text-theme-blue ${pathname ==='/about'?' text-theme-dark content-sub2-title-cn py-0' :'text-[#061E3B] font-normal'}`}>关于我们</Link>
<div>{data.theme}</div>
</div>
{/* <div className='right flex-grow-0'>
toolbar
......
......@@ -105,8 +105,6 @@ export const ScrollView = (props: ScrollViewType) => {
return prevState
})
scrollObj&&scrollObj.on('slidePageChanged', (page:any) => {
console.log('slidePageChanged',2332131231);
setCurrentPage((prevState: number)=>{
if(prevState !== page.pageY){
dispatch({type:'slideOnChange',payload:{pageIndex:page.pageY}})
......
......@@ -21,11 +21,12 @@ const AppReducer = (state:typeof data,action:Actions)=>{
switch(type){
case 'slideOnChange':
state.pageIndex = payload.pageIndex
if(state.currentPage==='/chain33'&&state.pageIndex===1&&state.theme==='light'){
if(state.currentPage==='/chain33'&&state.pageIndex===1){
state.theme = 'dark'
}else{
state.theme = 'light'
}
}
break;
case 'routerOnChange':
state.currentPage = payload.currentPage
......@@ -33,6 +34,7 @@ const AppReducer = (state:typeof data,action:Actions)=>{
}
console.log(state);
return state
}
......
export{
}
\ No newline at end of file
......@@ -66,10 +66,10 @@ export const EventItem = (props: EventItemType) => {
{data ? data.title : ""}
</div>
</div>
{open&&data && data.title.length > 42 && (
{open&&data && data.title.length > 37 && (
<div
ref={floating}
className="bg-theme-dark content-1-cn z-[999999] text-white py-5 px-3 w-[260px] rounded-md break-all"
className="bg-theme-dark content-1-cn z-[9999] text-white py-5 px-3 w-[260px] rounded-md break-all"
style={{
position: strategy,
top: y ?? 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment