This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split SettingsSection out of SettingsTab, replace usage (#10735)
* split SettingsSection out of SettingsTab, replace usage * correct copyright * fix VoipRoomSettingsTab
- Loading branch information
Kerry
authored
Apr 30, 2023
1 parent
3537699
commit 58c942b
Showing
9 changed files
with
174 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright 2023 New Vector Ltd | ||
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_SettingsSection { | ||
--SettingsTab_section-margin-bottom-preferences-labs: 30px; | ||
--SettingsTab_heading_nth_child-margin-top: 30px; /* TODO: Use a spacing variable */ | ||
--SettingsTab_fullWidthField-margin-inline-end: 100px; | ||
--SettingsTab_tooltip-max-width: 120px; /* So it fits in the space provided by the page */ | ||
|
||
color: $primary-content; | ||
|
||
a { | ||
color: $links; | ||
} | ||
} | ||
|
||
.mx_SettingsSection_subSections { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
grid-gap: $spacing-32; | ||
|
||
padding: $spacing-16 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
import React, { HTMLAttributes } from "react"; | ||
|
||
import Heading from "../../typography/Heading"; | ||
|
||
export interface SettingsSectionProps extends HTMLAttributes<HTMLDivElement> { | ||
heading: string | React.ReactNode; | ||
children?: React.ReactNode; | ||
} | ||
|
||
/** | ||
* A section of settings content | ||
* A SettingsTab may contain one or more SettingsSections | ||
* Eg: | ||
* ``` | ||
* <SettingsTab> | ||
* <SettingsSection heading="General"> | ||
* <SettingsSubsection heading="Profile"> | ||
* // profile settings form | ||
* <SettingsSubsection> | ||
* <SettingsSubsection heading="Account"> | ||
* // account settings | ||
* <SettingsSubsection> | ||
* </SettingsSection> | ||
* </SettingsTab> | ||
* ``` | ||
*/ | ||
export const SettingsSection: React.FC<SettingsSectionProps> = ({ heading, children, ...rest }) => ( | ||
<div {...rest} className="mx_SettingsSection"> | ||
{typeof heading === "string" ? <Heading size="h2">{heading}</Heading> : <>{heading}</>} | ||
<div className="mx_SettingsSection_subSections">{children}</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters