diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index bf9e791b..694ef054 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3980,9 +3980,6 @@ html>body #ajax-indicator { color: #fff; font-size: 16px; } -.head-right i{ - color: #fff!important; -} .head-nav ul#header-nav li a:hover,.head-nav ul#header-nav li.active a { color: #5091FF; diff --git a/src/forge/Component/HeadSearch.jsx b/src/forge/Component/HeadSearch.jsx index 10b829a2..0e44a2cd 100644 --- a/src/forge/Component/HeadSearch.jsx +++ b/src/forge/Component/HeadSearch.jsx @@ -32,7 +32,7 @@ export default ({history}) => { /> : - { + { setOpenSearch(true) }} /> } diff --git a/src/forge/Component/NoticeModal/SystemNotice.jsx b/src/forge/Component/NoticeModal/SystemNotice.jsx index 1560c1ff..02922415 100644 --- a/src/forge/Component/NoticeModal/SystemNotice.jsx +++ b/src/forge/Component/NoticeModal/SystemNotice.jsx @@ -3,25 +3,40 @@ import { Modal , Button } from 'antd'; import './Index.scss'; import '../../css/index.scss'; import RenderHtml from '../../../components/render-html'; -import cookie from 'react-cookies'; +// import cookie from 'react-cookies'; +import axios from 'axios'; -function SystemNotice({system_notification,history}){ +function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){ const [ visible , setVisible ] = useState(false); useEffect(()=>{ - if(system_notification && !cookie.load('notice_stage')){ + if(system_notification && !system_notification.is_read && showNotice && login){ setVisible(true); } - },[system_notification,history.location]) + },[system_notification]) function sureContinue() { - cookie.remove('notice_stage'); + if(login && ( system_notification && system_notification.id )){ + const url = `/users/${login}/system_notification_histories.json`; + axios.post(url,{ + system_notification_id:system_notification.id + }).then(result=>{ + if(result){ + setVisible(false); + hideSystemNotice(); + } + }).catch(error=>{}) + }else{ + setVisible(false); + hideSystemNotice(); + } + // cookie.remove('notice_stage'); - let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天 - // let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟 - cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" }); + // let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天 + // // let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟 + // cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" }); - setVisible(false); + // setVisible(false); } return ( diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 76423e38..a0a6db11 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -433,7 +433,8 @@ class NewHeader extends Component { { current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)? - + {/* */} + :"" } @@ -448,7 +449,8 @@ class NewHeader extends Component { > {current_user && - + {/* */} + } diff --git a/src/forge/Head/header.scss b/src/forge/Head/header.scss index 1d5ac90f..34e06510 100644 --- a/src/forge/Head/header.scss +++ b/src/forge/Head/header.scss @@ -326,13 +326,16 @@ } } } - .copyrightDesc{ - font-size: 12px; - font-weight: 400; - color: #BDC2D1; - line-height: 28px; - padding:15px 0px; - text-align: center; - background-color: #1B212C; +} +.copyrightDesc{ + font-size: 12px; + font-weight: 400; + color: #BDC2D1; + line-height: 28px; + padding:15px 0px; + text-align: center; + background-color: #1B212C; + a{ + color: #BDC2D1!important; } } \ No newline at end of file diff --git a/src/forge/Head/img/add.png b/src/forge/Head/img/add.png new file mode 100644 index 00000000..1790185e Binary files /dev/null and b/src/forge/Head/img/add.png differ diff --git a/src/forge/Head/img/ring.png b/src/forge/Head/img/ring.png new file mode 100644 index 00000000..0ca21d34 Binary files /dev/null and b/src/forge/Head/img/ring.png differ diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index bfd6105a..8327e232 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -328,7 +328,7 @@ function CoderDepot(props){ function okUpdate(d,w,l){ const url = `/${owner}/${projectsId}.json`; axios.put(url,{ - description:d,website:w,lesson_url:l + description:d,website:w || "",lesson_url:l||"" }).then(result=>{ if(result && result.data && result.data.id){ setDesc(result.data.description); diff --git a/src/home/Img/2-2-2.png b/src/home/Img/2-2-2.png index 1dde507a..52c2f8b9 100644 Binary files a/src/home/Img/2-2-2.png and b/src/home/Img/2-2-2.png differ diff --git a/src/home/Img/2-2-3.png b/src/home/Img/2-2-3.png index b0a9f6d0..2fb92ba2 100644 Binary files a/src/home/Img/2-2-3.png and b/src/home/Img/2-2-3.png differ diff --git a/src/home/Img/banner1.png b/src/home/Img/banner1.png index a4dbfd8b..b419349f 100644 Binary files a/src/home/Img/banner1.png and b/src/home/Img/banner1.png differ diff --git a/src/home/Img/banner2.png b/src/home/Img/banner2.png index 0e0e1025..35c8be4a 100644 Binary files a/src/home/Img/banner2.png and b/src/home/Img/banner2.png differ diff --git a/src/home/Img/banner3.png b/src/home/Img/banner3.png index e7c5b907..1a2912ba 100644 Binary files a/src/home/Img/banner3.png and b/src/home/Img/banner3.png differ diff --git a/src/home/Img/banner4.png b/src/home/Img/banner4.png index 9293cab6..a5f07759 100644 Binary files a/src/home/Img/banner4.png and b/src/home/Img/banner4.png differ diff --git a/src/home/Img/codeafter.png b/src/home/Img/codeafter.png index 189b000f..fdff2d77 100644 Binary files a/src/home/Img/codeafter.png and b/src/home/Img/codeafter.png differ diff --git a/src/home/Index.jsx b/src/home/Index.jsx index 0f193df0..1feea20d 100644 --- a/src/home/Index.jsx +++ b/src/home/Index.jsx @@ -1,6 +1,5 @@ import React , { useEffect , useState } from 'react'; import "./Index.scss"; -import HeadNav from './Headnav'; import TopEdition from './TopEdition'; import ThirdEdition from './ThirdEdition'; import { Anchor } from 'antd'; @@ -10,7 +9,6 @@ import F43 from './Img/4-3.png'; import F44 from './Img/4-4.png'; import SecondEdition from './SecondEdition'; import FifthEdition from './FifthEdition'; -import Footnav from './Footnav'; import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC'; function Index(props) { @@ -20,6 +18,7 @@ function Index(props) { const [ isloginCancel , setIsloginCancel ] = useState(false); const register = props && props.mygetHelmetapi && props.mygetHelmetapi.common && props.mygetHelmetapi.common.register; + const { current_user } = props; useEffect(()=>{ window.addEventListener("scroll",scrollListener); },[]) @@ -51,7 +50,7 @@ function Index(props) {
{/* */} - +
  • @@ -91,7 +90,9 @@ function Index(props) {

    加入GitLink,和社区伙伴们一起踏上开源创新的辉煌旅程!

    -
    快速注册 +
    + { !(current_user && current_user.login) && 立即注册 } +
    • diff --git a/src/home/Index.scss b/src/home/Index.scss index 4582f99a..10eff849 100644 --- a/src/home/Index.scss +++ b/src/home/Index.scss @@ -824,7 +824,6 @@ body{ background-color: #466AFF; border-radius: 6px; font-size: 18px; - margin-bottom: 80px; } .forthUl{ display: flex; @@ -1035,4 +1034,7 @@ body{ padding:15px 0px; text-align: center; background-color: #1B212C; + a{ + color: #BDC2D1!important; + } } \ No newline at end of file diff --git a/src/home/TopEdition.jsx b/src/home/TopEdition.jsx index abf41a57..99f32779 100644 --- a/src/home/TopEdition.jsx +++ b/src/home/TopEdition.jsx @@ -14,7 +14,7 @@ let setting={ prevArrow:, nextArrow: } -function TopEdition({register}) { +function TopEdition({register,current_user}) { return(
      @@ -22,7 +22,7 @@ function TopEdition({register}) {
      -

      注册

      + { !(current_user && current_user.login) &&

      注册

      }
      ) diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index a3166c35..5d976b7d 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -29,6 +29,7 @@ export function TPMIndexHOC(WrappedComponent) { email:undefined, completeProfile:false, showCP:false, + showNotice:true } } @@ -223,6 +224,11 @@ export function TPMIndexHOC(WrappedComponent) { } }).catch(error=>{}) } + hideSystemNotice=()=>{ + this.setState({ + showNotice:false + }) + } showCompeleteDialog=()=>{ this.setState({ @@ -231,7 +237,7 @@ export function TPMIndexHOC(WrappedComponent) { } render() { - let { isRender , current_user , giteaVisible , email , completeProfile , showCP , publicNav , mygetHelmetapi } = this.state; + let { isRender , current_user , giteaVisible , email , completeProfile , showCP , showNotice , publicNav , mygetHelmetapi } = this.state; const common = { showLoginDialog: this.showLoginDialog, checkIfLogin: this.checkIfLogin, @@ -241,9 +247,11 @@ export function TPMIndexHOC(WrappedComponent) { return (