|
| 1 | +import React from 'react'; |
| 2 | +import { dialogActions } from '../state/store.js'; |
| 3 | + |
| 4 | +export function AboutDialog(): JSX.Element { |
| 5 | + // App version comes from package.json at build time. Vite injects __APP_VERSION__ |
| 6 | + // via define; if not configured, fall back to a constant. |
| 7 | + const version = |
| 8 | + typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : '0.1.0'; |
| 9 | + |
| 10 | + return ( |
| 11 | + <div role="dialog" aria-modal="true" aria-labelledby="about-title" style={overlayStyle}> |
| 12 | + <div style={panelStyle}> |
| 13 | + <h2 id="about-title" style={{ margin: 0, fontSize: 22, fontWeight: 700 }}> |
| 14 | + Etherpad Desktop |
| 15 | + </h2> |
| 16 | + <p style={{ margin: 0, color: 'var(--text-muted)' }}>Version {version}</p> |
| 17 | + <p style={{ margin: '8px 0 0' }}> |
| 18 | + Native desktop client for{' '} |
| 19 | + <a |
| 20 | + href="https://etherpad.org/" |
| 21 | + target="_blank" |
| 22 | + rel="noopener noreferrer" |
| 23 | + style={{ color: 'var(--accent)', textDecoration: 'none' }} |
| 24 | + > |
| 25 | + Etherpad |
| 26 | + </a> |
| 27 | + . |
| 28 | + </p> |
| 29 | + <p style={{ margin: '8px 0 0', color: 'var(--text-muted)', fontSize: 13 }}> |
| 30 | + Released under the Apache-2.0 license. Source on{' '} |
| 31 | + <a |
| 32 | + href="https://github.com/ether/etherpad-desktop" |
| 33 | + target="_blank" |
| 34 | + rel="noopener noreferrer" |
| 35 | + style={{ color: 'var(--accent)', textDecoration: 'none' }} |
| 36 | + > |
| 37 | + GitHub |
| 38 | + </a> |
| 39 | + . |
| 40 | + </p> |
| 41 | + <p style={{ margin: '8px 0 0', color: 'var(--text-muted)', fontSize: 13 }}> |
| 42 | + Made by the Etherpad Foundation and contributors. |
| 43 | + </p> |
| 44 | + <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 16 }}> |
| 45 | + <button className="btn-primary" onClick={() => dialogActions.closeDialog()}> |
| 46 | + Close |
| 47 | + </button> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + ); |
| 52 | +} |
| 53 | + |
| 54 | +const overlayStyle: React.CSSProperties = { |
| 55 | + position: 'fixed', |
| 56 | + inset: 0, |
| 57 | + background: 'var(--modal-overlay-bg)', |
| 58 | + display: 'grid', |
| 59 | + placeItems: 'center', |
| 60 | + zIndex: 100, |
| 61 | +}; |
| 62 | +const panelStyle: React.CSSProperties = { |
| 63 | + background: 'var(--panel-bg)', |
| 64 | + color: 'var(--panel-fg)', |
| 65 | + padding: 24, |
| 66 | + borderRadius: 12, |
| 67 | + width: 380, |
| 68 | + display: 'flex', |
| 69 | + flexDirection: 'column', |
| 70 | + gap: 4, |
| 71 | + boxShadow: 'var(--panel-shadow)', |
| 72 | + border: '1px solid var(--panel-border)', |
| 73 | +}; |
0 commit comments