diff --git a/app/assets/stylesheets/chat.scss b/app/assets/stylesheets/chat.scss
index e20290263..7b1449af8 100644
--- a/app/assets/stylesheets/chat.scss
+++ b/app/assets/stylesheets/chat.scss
@@ -12,14 +12,11 @@
}
.live-chat {
- /* height: calc(100vh - 56px); */
-
&.live-chat--iossafari {
height: calc(100vh - 56px);
}
overflow-y: hidden;
- /* height: calc(100 * var(--vh) - var(--header-height)); */
}
.live-chat {
@@ -552,8 +549,17 @@
font-weight: bold;
cursor: pointer;
- img {
+ button {
opacity: 0.6;
+ border: none;
+ height: 18px;
+ width: 18px;
+ background-size: cover;
+ background-color: transparent;
+ }
+
+ ul {
+ padding: 12px 10px;
}
&:hover {
@@ -564,10 +570,8 @@
}
.chatchannels__configmenu {
- display: none;
position: absolute;
bottom: 42px;
- padding: 12px 10px;
min-width: 150px;
left: 0;
right: 0;
@@ -575,10 +579,13 @@
border-top: 1px solid $light-medium-gray;
font-size: 13px;
- a {
- color: $dark-gray;
- display: block;
- padding: 5px 0px;
+ li {
+ list-style: none;
+ a {
+ color: $dark-gray;
+ display: block;
+ padding: 5px 0px;
+ }
}
}
diff --git a/app/javascript/chat/__tests__/channels.test.jsx b/app/javascript/chat/__tests__/channels.test.jsx
index f42be343b..0d3018914 100644
--- a/app/javascript/chat/__tests__/channels.test.jsx
+++ b/app/javascript/chat/__tests__/channels.test.jsx
@@ -1,5 +1,5 @@
import { h } from 'preact';
-import { render } from '@testing-library/preact';
+import { render, fireEvent } from '@testing-library/preact';
import { JSDOM } from 'jsdom';
import { axe } from 'jest-axe';
import { Channels } from '../channels';
@@ -107,7 +107,9 @@ describe('', () => {
expect(queryByRole('alert')).toBeNull();
// configFooter should exist
- getByRole('menu');
+ fireEvent.click(
+ getByRole('button', { name: /configuration navigation menu/i }),
+ );
const settings = getByText('Settings');
expect(settings.getAttribute('href')).toEqual('/settings');
@@ -121,7 +123,9 @@ describe('', () => {
// should show "Welcome to Connect message....."
getByRole('alert');
- getByRole('menu');
+ fireEvent.click(
+ getByRole('button', { name: /configuration navigation menu/i }),
+ );
const settings = getByText('Settings');
expect(settings.getAttribute('href')).toEqual('/settings');
diff --git a/app/javascript/chat/channels.jsx b/app/javascript/chat/channels.jsx
index 42baa2560..977216c9b 100644
--- a/app/javascript/chat/channels.jsx
+++ b/app/javascript/chat/channels.jsx
@@ -1,8 +1,7 @@
import { h } from 'preact';
import PropTypes from 'prop-types';
-// eslint-disable-next-line import/no-unresolved
-import ConfigImage from 'images/overflow-horizontal.svg';
import { ChannelButton } from './components/ChannelButton';
+import { ConfigMenu } from './configMenu';
import { channelSorter } from './util';
export const Channels = ({
@@ -78,23 +77,6 @@ export const Channels = ({
...
);
}
- let configFooter = '';
- if (expanded) {
- // TODO: The below should be converted into a real menu or
- configFooter = (
-
-

-
-
- );
- }
return (
- {configFooter}
+
+
);
};
diff --git a/app/javascript/chat/configMenu.jsx b/app/javascript/chat/configMenu.jsx
new file mode 100644
index 000000000..616bc1e7c
--- /dev/null
+++ b/app/javascript/chat/configMenu.jsx
@@ -0,0 +1,53 @@
+import { h, Component, createRef } from 'preact';
+// eslint-disable-next-line import/no-unresolved
+import ConfigImage from 'images/overflow-horizontal.svg';
+
+export class ConfigMenu extends Component {
+ constructor() {
+ super();
+ this.state = { visible: false };
+ this.firstNavLink = createRef();
+ this.configMenuButton = createRef();
+ }
+
+ handleClick = () => {
+ this.setState(
+ (prevState) => ({ visible: !prevState.visible }),
+ () => {
+ this.state.visible
+ ? this.firstNavLink.current.focus()
+ : this.configMenuButton.current.focus();
+ },
+ );
+ };
+
+ render() {
+ const { visible } = this.state;
+
+ return (
+
+
+ {visible && (
+
+ )}
+
+ );
+ }
+}