File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ import jobToMarkdown from "../jobToMarkdown.mjs";
88const Job = ( { job } ) => {
99 const processedJob = React . useMemo ( ( ) => jobToMarkdown ( job ) , [ job ] ) ;
1010
11+ const isExpired = React . useMemo ( ( ) => {
12+ if ( ! processedJob || ! processedJob . expires ) return false ;
13+ const today = new Date ( ) ;
14+ return new Date ( `${ processedJob . expires } T23:59:59.999-12:00` ) < today ;
15+ } , [ processedJob ] ) ;
16+
1117 if ( processedJob === undefined ) {
1218 console . log ( "We don't expect an empty job posting; aborting" ) ;
1319 return < div > Empty job posting</ div > ;
@@ -51,6 +57,11 @@ const Job = ({ job }) => {
5157 </ div >
5258 }
5359 </ div >
60+ { isExpired && (
61+ < div className = "expired-banner" >
62+ This job post has expired and is no longer open for applications.
63+ </ div >
64+ ) }
5465 < div
5566 className = "description"
5667 dangerouslySetInnerHTML = { { __html : processedJob . description } }
Original file line number Diff line number Diff line change 2727a {
2828 color : # 2c3e50 ;
2929 font-weight : bold;
30- text-decoration : none;
3130}
3231.page {
3332}
114113 bottom : 1rem ;
115114 right : 1rem ;
116115}
116+ .expired-banner {
117+ background-color : # f8d7da ;
118+ color : # 721c24 ;
119+ padding : 0.5rem ;
120+ margin-bottom : 0.75rem ;
121+ margin-top : 1rem ;
122+ border-radius : 4px ;
123+ text-align : center;
124+ font-weight : bold;
125+ font-size : 0.9rem ;
126+ }
117127.job a {
118- text-decoration : none;
119128}
120129.job .meta a {
121130 font-weight : normal;
You can’t perform that action at this time.
0 commit comments