v0.9.17 branding bug fixes
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
PROJECT_NAME=jama
|
PROJECT_NAME=jama
|
||||||
|
|
||||||
# Image version to run (set by build.sh, or use 'latest')
|
# Image version to run (set by build.sh, or use 'latest')
|
||||||
JAMA_VERSION=0.9.16
|
JAMA_VERSION=0.9.17
|
||||||
|
|
||||||
# App port — the host port Docker maps to the container
|
# App port — the host port Docker maps to the container
|
||||||
PORT=3000
|
PORT=3000
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jama-backend",
|
"name": "jama-backend",
|
||||||
"version": "0.9.16",
|
"version": "0.9.17",
|
||||||
"description": "TeamChat backend server",
|
"description": "TeamChat backend server",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
2
build.sh
2
build.sh
@@ -13,7 +13,7 @@
|
|||||||
# ─────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
VERSION="${1:-0.9.16}"
|
VERSION="${1:-0.9.17}"
|
||||||
ACTION="${2:-}"
|
ACTION="${2:-}"
|
||||||
REGISTRY="${REGISTRY:-}"
|
REGISTRY="${REGISTRY:-}"
|
||||||
IMAGE_NAME="jama"
|
IMAGE_NAME="jama"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jama-frontend",
|
"name": "jama-frontend",
|
||||||
"version": "0.9.16",
|
"version": "0.9.17",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -7,28 +7,33 @@ const DEFAULT_PUBLIC_COLOR = '#1a73e8';
|
|||||||
const DEFAULT_DM_COLOR = '#a142f4';
|
const DEFAULT_DM_COLOR = '#a142f4';
|
||||||
|
|
||||||
const COLOUR_SUGGESTIONS = [
|
const COLOUR_SUGGESTIONS = [
|
||||||
'#1a73e8','#a142f4','#e53935','#34a853','#fa7b17',
|
'#1a73e8', '#a142f4', '#e53935', '#fa7b17', '#fdd835', '#34a853',
|
||||||
'#00897b','#e91e8c','#0097a7','#5c6bc0','#f4511e',
|
|
||||||
'#616161','#795548','#00acc1','#43a047','#fdd835',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// A single colour picker card: shows suggestions by default, Custom button opens native picker
|
// A single colour picker card: shows suggestions by default, Custom button opens native picker
|
||||||
function ColourPicker({ label, description, value, onChange, preview }) {
|
function ColourPicker({ label, value, onChange, preview }) {
|
||||||
const [mode, setMode] = useState('suggestions'); // 'suggestions' | 'custom'
|
const [mode, setMode] = useState('suggestions'); // 'suggestions' | 'custom'
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
|
|
||||||
const handleCustomClick = () => {
|
// Auto-close custom mode as soon as a new colour is committed
|
||||||
setMode('custom');
|
const handleCustomChange = (e) => {
|
||||||
// Open native colour picker immediately after switching
|
onChange(e.target.value);
|
||||||
setTimeout(() => inputRef.current?.click(), 50);
|
// 'change' fires on close of native picker on most platforms;
|
||||||
|
// we also listen to 'input' for live preview but only close on 'change'
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCustomInput = (e) => {
|
||||||
|
onChange(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCustomChangeClose = (e) => {
|
||||||
|
onChange(e.target.value);
|
||||||
|
setMode('suggestions');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="settings-section-label">{label}</div>
|
<div className="settings-section-label">{label}</div>
|
||||||
{description && (
|
|
||||||
<p style={{ fontSize: 12, color: 'var(--text-tertiary)', marginBottom: 12 }}>{description}</p>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Current colour preview */}
|
{/* Current colour preview */}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
|
||||||
@@ -41,8 +46,7 @@ function ColourPicker({ label, description, value, onChange, preview }) {
|
|||||||
|
|
||||||
{mode === 'suggestions' && (
|
{mode === 'suggestions' && (
|
||||||
<>
|
<>
|
||||||
{/* Suggestion swatches */}
|
<div style={{ display: 'flex', gap: 8, marginBottom: 12 }}>
|
||||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, marginBottom: 12 }}>
|
|
||||||
{COLOUR_SUGGESTIONS.map(hex => (
|
{COLOUR_SUGGESTIONS.map(hex => (
|
||||||
<button
|
<button
|
||||||
key={hex}
|
key={hex}
|
||||||
@@ -58,11 +62,7 @@ function ColourPicker({ label, description, value, onChange, preview }) {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{/* Custom button — styled to match suggestion swatches row */}
|
<button className="btn btn-secondary btn-sm" onClick={() => setMode('custom')}>
|
||||||
<button
|
|
||||||
className="btn btn-secondary btn-sm"
|
|
||||||
onClick={handleCustomClick}
|
|
||||||
>
|
|
||||||
Custom
|
Custom
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
@@ -70,26 +70,27 @@ function ColourPicker({ label, description, value, onChange, preview }) {
|
|||||||
|
|
||||||
{mode === 'custom' && (
|
{mode === 'custom' && (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
{/* Colour input rendered as a large clickable swatch — works on mobile and desktop */}
|
||||||
|
<label style={{ display: 'flex', alignItems: 'center', gap: 12, cursor: 'pointer' }}>
|
||||||
|
<span style={{
|
||||||
|
display: 'inline-block', width: 56, height: 44,
|
||||||
|
borderRadius: 8, background: value,
|
||||||
|
border: '2px solid var(--border)',
|
||||||
|
boxShadow: '0 1px 4px rgba(0,0,0,0.15)',
|
||||||
|
flexShrink: 0,
|
||||||
|
}} />
|
||||||
<input
|
<input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
type="color"
|
type="color"
|
||||||
value={value}
|
value={value}
|
||||||
onChange={e => onChange(e.target.value)}
|
onInput={handleCustomInput}
|
||||||
style={{
|
onChange={handleCustomChangeClose}
|
||||||
width: 56, height: 44, padding: 2,
|
style={{ position: 'absolute', opacity: 0, width: 0, height: 0, pointerEvents: 'none' }}
|
||||||
borderRadius: 8, border: '1px solid var(--border)',
|
|
||||||
cursor: 'pointer', background: 'none',
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<span style={{ fontSize: 13, color: 'var(--text-secondary)', fontFamily: 'monospace' }}>{value}</span>
|
<span style={{ fontSize: 13, color: 'var(--text-secondary)', fontFamily: 'monospace' }}>{value}</span>
|
||||||
</div>
|
</label>
|
||||||
{/* Back button — same style as Custom button */}
|
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button className="btn btn-secondary btn-sm" onClick={() => setMode('suggestions')}>
|
||||||
className="btn btn-secondary btn-sm"
|
|
||||||
onClick={() => setMode('suggestions')}
|
|
||||||
>
|
|
||||||
Back
|
Back
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -285,7 +286,6 @@ export default function BrandingModal({ onClose }) {
|
|||||||
<div className="flex-col gap-3">
|
<div className="flex-col gap-3">
|
||||||
<ColourPicker
|
<ColourPicker
|
||||||
label="App Title Colour"
|
label="App Title Colour"
|
||||||
description="The colour of the app name shown in the top bar."
|
|
||||||
value={colourTitle}
|
value={colourTitle}
|
||||||
onChange={setColourTitle}
|
onChange={setColourTitle}
|
||||||
/>
|
/>
|
||||||
@@ -293,7 +293,6 @@ export default function BrandingModal({ onClose }) {
|
|||||||
<div style={{ borderTop: '1px solid var(--border)', paddingTop: 20 }}>
|
<div style={{ borderTop: '1px solid var(--border)', paddingTop: 20 }}>
|
||||||
<ColourPicker
|
<ColourPicker
|
||||||
label="Public Message Avatar Colour"
|
label="Public Message Avatar Colour"
|
||||||
description="Background colour for public channel icons (users without a custom avatar)."
|
|
||||||
value={colourPublic}
|
value={colourPublic}
|
||||||
onChange={setColourPublic}
|
onChange={setColourPublic}
|
||||||
preview={(val) => (
|
preview={(val) => (
|
||||||
@@ -309,7 +308,6 @@ export default function BrandingModal({ onClose }) {
|
|||||||
<div style={{ borderTop: '1px solid var(--border)', paddingTop: 20 }}>
|
<div style={{ borderTop: '1px solid var(--border)', paddingTop: 20 }}>
|
||||||
<ColourPicker
|
<ColourPicker
|
||||||
label="Direct Message Avatar Colour"
|
label="Direct Message Avatar Colour"
|
||||||
description="Background colour for private group and direct message icons (users without a custom avatar)."
|
|
||||||
value={colourDm}
|
value={colourDm}
|
||||||
onChange={setColourDm}
|
onChange={setColourDm}
|
||||||
preview={(val) => (
|
preview={(val) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user