diff --git a/src/components/home/notice.js b/src/components/home/notice.js index 867ca22c..2006b0f6 100644 --- a/src/components/home/notice.js +++ b/src/components/home/notice.js @@ -21,52 +21,42 @@ const BlinkingText = styled.span` ` const Notice = props => { - // const newtime = new Date().getTime() - - // let d = Math.round((newtime - props.time) / 3600000) - // if (d > 48) { - // d = new Date(props.time).toLocaleDateString() - // } else if (d > 24) { - // d = `${Math.round(d / 24)} days ago` - // } else if (d < 1) { - // d = `Just now` - // } else if (d < 2) { - // d = `${d} hour ago` - // } else { - // d = `${d} hours ago` - // } return ( <>

- {props.imp == 1 ? f : ""} - {props.imp == 1 ? ( - - {" "} - {props.detail} - - ) : ( - "" - )} - {props.imp != 1 ? ( + {props.imp === 1 ? f : ""} + {props.imp === 1 ? ( + props.link ? ( + + {" "} + {props.detail} + + ) : ( + + {" "} + {props.detail} + + ) + ) : props.link ? ( {" "} {props.detail} ) : ( - "" + {props.detail} )}

- {props.attachments.map(elem => { + {props.attachments.map((elem, index) => { if (elem.url) return ( -
) } + export default Notice