Location share type UI (#7924)

* copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* empty line

Signed-off-by: Kerry Archibald <kerrya@element.io>

* functional picker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* most style

Signed-off-by: Kerry Archibald <kerrya@element.io>

* nice style for options

Signed-off-by: Kerry Archibald <kerrya@element.io>

* get ShareType test passing

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add maplibre mock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint and test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add section to themes for location sharing cols

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add svg mock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use same mock string as imageMock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* newline

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add live location icon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename useEnabledShareTypes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use solid color for live border

* use ternary

Signed-off-by: Kerry Archibald <kerrya@element.io>

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Kerry 2022-03-02 14:00:40 +01:00 committed by GitHub
parent 547144a565
commit b480bffab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 354 additions and 298 deletions

View file

@ -0,0 +1,108 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_ShareType {
flex: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding: 60px $spacing-12 $spacing-32;
color: $primary-content;
}
.mx_ShareType_badge {
height: 60px;
width: 60px;
margin-bottom: $spacing-20;
background-color: $accent;
border-radius: 50%;
border: 14px solid $accent;
// colors icon
color: white;
box-sizing: border-box;
}
.mx_ShareType_heading {
padding-bottom: $spacing-32;
text-align: center;
}
.mx_ShareType_option {
@mixin ButtonResetDefault;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
padding: $spacing-8 $spacing-20;
margin-top: $spacing-12;
color: $primary-content;
border: 1px solid $quinary-content;
border-radius: 8px;
font-size: $font-15px;
&:hover, &:focus {
border-color: $accent;
}
// this style is only during active development
// when lab is enabled but feature not fully implemented
// pin drop option will be disabled
&.mx_AccessibleButton_disabled {
pointer-events: none;
opacity: 0.4;
}
}
.mx_ShareType_option-icon {
height: 40px;
width: 40px;
box-sizing: border-box;
margin-right: $spacing-12;
flex: 0 0 40px;
border-width: 2px;
border-style: solid;
border-radius: 50%;
&.Own {
// color is set by user color class
// generated from id
border-color: currentColor;
}
&.Live {
background-color: $location-live-color;
// 20% brightness $location-live-color
border-color: #deddfd;
padding: 2px;
// colors icon
color: white;
}
&.Pin {
border-color: $accent;
background-color: $accent;
padding: 7px;
// colors icon
color: white;
}
}