From 6ffcece3fac0d3348e8d66c59239296c29cd6eb4 Mon Sep 17 00:00:00 2001 From: MathieuCarteron Date: Thu, 11 Jun 2026 00:24:13 +0200 Subject: [PATCH 1/2] =?UTF-8?q?cr=C3=A9ation=20de=20groupe=20d=C3=A9but?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/core/chat/discussion.service.ts | 4 + .../menu/menu-nav/menu-nav.component.css | 155 ++++++++++++++++++ .../menu/menu-nav/menu-nav.component.html | 95 +++++++++-- .../pages/menu/menu-nav/menu-nav.component.ts | 58 ++++++- src/app/services/api/.openapi-generator/FILES | 1 + .../services/api/api/discussions.service.ts | 70 ++++++++ ...cussion-create-group-discussion-request.ts | 16 ++ src/app/services/api/model/models.ts | 1 + 8 files changed, 379 insertions(+), 21 deletions(-) create mode 100644 src/app/services/api/model/knots-endpoints-discussion-create-group-discussion-request.ts diff --git a/src/app/core/chat/discussion.service.ts b/src/app/core/chat/discussion.service.ts index 15e90ee..9bf68cf 100644 --- a/src/app/core/chat/discussion.service.ts +++ b/src/app/core/chat/discussion.service.ts @@ -28,4 +28,8 @@ export class discussionsService { createPrivateDiscussion(username: string): Observable { return this.http.post(`${this.apiUrl}/discussions/private`, { username }); } + + createGroupDiscussion(groupName: string, usernames: string[]): Observable { + return this.http.post(`${this.apiUrl}/discussions/group`, { groupName, usernames }); + } } \ No newline at end of file diff --git a/src/app/pages/menu/menu-nav/menu-nav.component.css b/src/app/pages/menu/menu-nav/menu-nav.component.css index c24a21a..7a4309c 100644 --- a/src/app/pages/menu/menu-nav/menu-nav.component.css +++ b/src/app/pages/menu/menu-nav/menu-nav.component.css @@ -107,4 +107,159 @@ transform: scale(0.97); box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1); } +} + +.mode-switch { + margin-top: auto; + + display: flex; + align-items: center; + justify-content: space-between; + + padding: 14px 16px; + + background: rgba(255, 255, 255, 0.2); + border-radius: 16px; + + backdrop-filter: blur(8px); + box-shadow: 0 2px 12px rgba(122, 46, 46, 0.08); +} + +.switch-label { + color: #7a2e2e; + font-weight: 600; + font-size: 0.95rem; +} + +/* SWITCH */ + +.switch { + position: relative; + width: 58px; + height: 32px; +} + +.switch input { + display: none; +} + +.slider { + position: absolute; + inset: 0; + + cursor: pointer; + + background: rgba(255, 255, 255, 0.6); + border-radius: 999px; + + transition: all 0.25s ease; + + box-shadow: + inset 0 1px 3px rgba(0,0,0,0.08), + 0 2px 8px rgba(0,0,0,0.05); +} + +.slider::before { + content: ""; + + position: absolute; + top: 4px; + left: 4px; + + width: 24px; + height: 24px; + + border-radius: 50%; + background: white; + + transition: all 0.25s ease; + + box-shadow: + 0 2px 8px rgba(0,0,0,0.15); +} + +.switch input:checked + .slider { + background: #bd5a5a; +} + +.switch input:checked + .slider::before { + transform: translateX(26px); +} + +.mode-switch:hover .slider { + transform: scale(1.03); +} + +.add-member-btn { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + + width: 100%; + + padding: 12px 16px; + + border: 2px dashed rgba(189, 90, 90, 0.35); + border-radius: 14px; + + background: rgba(255, 255, 255, 0.55); + + color: #bd5a5a; + font-size: 0.95rem; + font-weight: 600; + + cursor: pointer; + + transition: all 0.2s ease; + + ion-icon { + font-size: 1.2rem; + } + + &:hover { + background: rgba(255, 255, 255, 0.8); + border-color: #bd5a5a; + transform: translateY(-1px); + } + + &:active { + transform: scale(0.98); + } +} + +.remove-btn { + width: 26px; + height: 26px; + + flex-shrink: 0; + + display: flex; + align-items: center; + justify-content: center; + + border: none; + border-radius: 50%; + + background: white; + color: #bd5a5a; + + cursor: pointer; + + box-shadow: 0 2px 8px rgba(180, 80, 80, 0.12); + + transition: all 0.2s ease; + + ion-icon { + font-size: 1.1rem; + } + + &:hover { + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(180, 80, 80, 0.18); + } + + &:active { + transform: scale(0.92); + } } \ No newline at end of file diff --git a/src/app/pages/menu/menu-nav/menu-nav.component.html b/src/app/pages/menu/menu-nav/menu-nav.component.html index cda9904..d46da27 100644 --- a/src/app/pages/menu/menu-nav/menu-nav.component.html +++ b/src/app/pages/menu/menu-nav/menu-nav.component.html @@ -11,30 +11,91 @@