Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b061c94

Browse files
committed
Copy Jump to Date PoC changes on top of RovingTabIndex fixes
Copy changes from #7317 on top of RovingTabIndex fixes in #7336
1 parent 1784b44 commit b061c94

File tree

9 files changed

+338
-20
lines changed

9 files changed

+338
-20
lines changed

res/css/views/context_menus/_IconizedContextMenu.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ limitations under the License.
5050
}
5151

5252
// round the top corners of the top button for the hover effect to be bounded
53-
&:first-child .mx_AccessibleButton:first-child {
53+
&:first-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):first-child {
5454
border-radius: 8px 8px 0 0; // radius matches .mx_ContextualMenu
5555
}
5656

5757
// round the bottom corners of the bottom button for the hover effect to be bounded
58-
&:last-child .mx_AccessibleButton:last-child {
58+
&:last-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):last-child {
5959
border-radius: 0 0 8px 8px; // radius matches .mx_ContextualMenu
6060
}
6161

6262
// round all corners of the only button for the hover effect to be bounded
63-
&:first-child:last-child .mx_AccessibleButton:first-child:last-child {
63+
&:first-child:last-child .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind):first-child:last-child {
6464
border-radius: 8px; // radius matches .mx_ContextualMenu
6565
}
6666

67-
.mx_AccessibleButton {
67+
.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
6868
// pad the inside of the button so that the hover background is padded too
6969
padding-top: 12px;
7070
padding-bottom: 12px;
@@ -130,7 +130,7 @@ limitations under the License.
130130
}
131131

132132
.mx_IconizedContextMenu_optionList_red {
133-
.mx_AccessibleButton {
133+
.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
134134
color: $alert !important;
135135
}
136136

@@ -148,7 +148,7 @@ limitations under the License.
148148
}
149149

150150
.mx_IconizedContextMenu_active {
151-
&.mx_AccessibleButton, .mx_AccessibleButton {
151+
&.mx_AccessibleButton:not(.mx_AccessibleButton_hasKind), .mx_AccessibleButton:not(.mx_AccessibleButton_hasKind) {
152152
color: $accent !important;
153153
}
154154

res/css/views/elements/_Field.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ limitations under the License.
127127
transform 0.25s ease-out 0s,
128128
background-color 0.25s ease-out 0s;
129129
font-size: $font-10px;
130+
line-height: normal;
130131
transform: translateY(-13px);
131132
padding: 0 2px;
132133
background-color: $background;

res/css/views/messages/_DateSeparator.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,37 @@ limitations under the License.
3333
margin: 0 25px;
3434
flex: 0 0 auto;
3535
}
36+
37+
.mx_DateSeparator_jumpToDateMenu {
38+
display: flex;
39+
}
40+
41+
.mx_DateSeparator_chevron {
42+
align-self: center;
43+
width: 16px;
44+
height: 16px;
45+
mask-position: center;
46+
mask-size: contain;
47+
mask-repeat: no-repeat;
48+
mask-image: url('$(res)/img/feather-customised/chevron-down.svg');
49+
background-color: $tertiary-content;
50+
}
51+
52+
.mx_DateSeparator_jumpToDateMenuOption > .mx_IconizedContextMenu_label {
53+
flex: initial;
54+
width: auto;
55+
}
56+
57+
.mx_DateSeparator_datePickerForm {
58+
display: flex;
59+
}
60+
61+
.mx_DateSeparator_datePicker {
62+
flex: initial;
63+
margin: 0;
64+
margin-left: 8px;
65+
}
66+
67+
.mx_DateSeparator_datePickerSubmitButton {
68+
margin-left: 8px;
69+
}

src/components/structures/MessagePanel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,8 @@ export default class MessagePanel extends React.Component<IProps, IState> {
715715

716716
// do we need a date separator since the last event?
717717
const wantsDateSeparator = this.wantsDateSeparator(prevEvent, eventDate);
718-
if (wantsDateSeparator && !isGrouped) {
719-
const dateSeparator = <li key={ts1}><DateSeparator key={ts1} ts={ts1} /></li>;
718+
if (wantsDateSeparator && !isGrouped && this.props.room) {
719+
const dateSeparator = <li key={ts1}><DateSeparator key={ts1} roomId={this.props.room.roomId} ts={ts1} /></li>;
720720
ret.push(dateSeparator);
721721
}
722722

@@ -1109,7 +1109,7 @@ class CreationGrouper extends BaseGrouper {
11091109
if (panel.wantsDateSeparator(this.prevEvent, createEvent.getDate())) {
11101110
const ts = createEvent.getTs();
11111111
ret.push(
1112-
<li key={ts+'~'}><DateSeparator key={ts+'~'} ts={ts} /></li>,
1112+
<li key={ts+'~'}><DateSeparator key={ts+'~'} roomId={createEvent.getRoomId()} ts={ts} /></li>,
11131113
);
11141114
}
11151115

@@ -1222,7 +1222,7 @@ class RedactionGrouper extends BaseGrouper {
12221222
if (panel.wantsDateSeparator(this.prevEvent, this.events[0].getDate())) {
12231223
const ts = this.events[0].getTs();
12241224
ret.push(
1225-
<li key={ts+'~'}><DateSeparator key={ts+'~'} ts={ts} /></li>,
1225+
<li key={ts+'~'}><DateSeparator key={ts+'~'} roomId={this.events[0].getRoomId()} ts={ts} /></li>,
12261226
);
12271227
}
12281228

@@ -1318,7 +1318,7 @@ class MemberGrouper extends BaseGrouper {
13181318
if (panel.wantsDateSeparator(this.prevEvent, this.events[0].getDate())) {
13191319
const ts = this.events[0].getTs();
13201320
ret.push(
1321-
<li key={ts+'~'}><DateSeparator key={ts+'~'} ts={ts} /></li>,
1321+
<li key={ts+'~'}><DateSeparator key={ts+'~'} roomId={this.events[0].getRoomId()} ts={ts} /></li>,
13221322
);
13231323
}
13241324

src/components/views/elements/Field.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { debounce } from "lodash";
2020

2121
import * as sdk from '../../../index';
2222
import { IFieldState, IValidationResult } from "./Validation";
23+
import { ComponentClass } from "../../../@types/common";
2324

2425
// Invoke validation from user input (when typing, etc.) at most once every N ms.
2526
const VALIDATION_THROTTLE_MS = 200;
@@ -97,7 +98,16 @@ interface ITextareaProps extends IProps, TextareaHTMLAttributes<HTMLTextAreaElem
9798
value: string;
9899
}
99100

100-
type PropShapes = IInputProps | ISelectProps | ITextareaProps;
101+
export interface ICustomInputProps extends IProps, InputHTMLAttributes<HTMLInputElement> {
102+
// The element to create.
103+
element: ComponentClass;
104+
// The input's value. This is a controlled component, so the value is required.
105+
value: string;
106+
// Optionally can be used for the CustomInput
107+
onInput?: React.ChangeEventHandler<HTMLInputElement>;
108+
}
109+
110+
type PropShapes = IInputProps | ISelectProps | ITextareaProps | ICustomInputProps;
101111

102112
interface IState {
103113
valid: boolean;
@@ -257,7 +267,7 @@ export default class Field extends React.PureComponent<PropShapes, IState> {
257267
}
258268

259269
const hasValidationFlag = forceValidity !== null && forceValidity !== undefined;
260-
const fieldClasses = classNames("mx_Field", `mx_Field_${this.props.element}`, className, {
270+
const fieldClasses = classNames("mx_Field", `mx_Field_${typeof this.props.element === "string" ? this.props.element : "input"}`, className, {
261271
// If we have a prefix element, leave the label always at the top left and
262272
// don't animate it, as it looks a bit clunky and would add complexity to do
263273
// properly.

0 commit comments

Comments
 (0)