Skip to content

Commit

Permalink
ux/views: factored the {dead} screen out of {stop}
Browse files Browse the repository at this point in the history
  • Loading branch information
aivazis committed Oct 21, 2023
1 parent 2c2a321 commit 38c3f62
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ux/client/views/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export { NYI } from './nyi'
// while {suspense} is waiting
export Loading from './loading'
// the page rendered when the user kills the server
export { Stop } from './stop'
export { Stop, Dead } from './stop'


// end of file
28 changes: 28 additions & 0 deletions ux/client/views/stop/dead.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- web -*-
//
// michael a.g. aïvázis <michael.aivazis@para-sim.com>
// (c) 1998-2023 all rights reserved


// externals
import React from 'react'
// locals
import styles from './styles'


// show the dead screen
export const Dead = () => {
// render
return (
<section style={styles.stop}>
<div style={styles.placeholder}>
<a href="/" style={styles.link}>qed</a>
{" "}
has shut down; please close this window
</div>
</section>
)
}


// end of file
27 changes: 3 additions & 24 deletions ux/client/views/stop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,8 @@

// externals
import React from 'react'
import { Link } from 'react-router-dom'
// locals
import styles from './styles'


// kill the server
export const Stop = () => {
// ask the server to shut down
fetch('stop').catch(
// and swallow any errors
() => null
)

// the container
return (
<section style={styles.stop}>
<div style={styles.placeholder}>
<Link to="/" style={styles.link}>qed</Link>
&nbsp;has shut down; please close this window
</div>
</section>
)
}

// components
export { Dead } from './dead'
export { Stop } from './stop'

// end of file
29 changes: 29 additions & 0 deletions ux/client/views/stop/stop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// -*- web -*-
//
// michael a.g. aïvázis <michael.aivazis@para-sim.com>
// (c) 1998-2023 all rights reserved


// externals
import React from 'react'

// locals
// components
import { Dead } from './dead'


// kill the server
export const Stop = () => {
// ask the server to shut down
fetch('stop').catch(
// and swallow any errors
() => null
)
// render the dead screen
return (
<Dead />
)
}


// end of file

0 comments on commit 38c3f62

Please sign in to comment.