mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 00:38:27 +00:00
[WIP] Initial status work
This commit is contained in:
49
app/javascript/glitch/components/common/separator/index.js
Normal file
49
app/javascript/glitch/components/common/separator/index.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// <CommonSeparator>
|
||||
// ========
|
||||
|
||||
// For code documentation, please see:
|
||||
// https://glitch-soc.github.io/docs/javascript/glitch/common/separator
|
||||
|
||||
// For more information, please contact:
|
||||
// @kibi@glitch.social
|
||||
|
||||
// * * * * * * * //
|
||||
|
||||
// Imports
|
||||
// -------
|
||||
|
||||
// Package imports.
|
||||
import classNames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
// Stylesheet imports.
|
||||
import './style';
|
||||
|
||||
// * * * * * * * //
|
||||
|
||||
// The component
|
||||
// -------------
|
||||
|
||||
const CommonSeparator = ({
|
||||
className,
|
||||
visible,
|
||||
...others
|
||||
}) => visible ? (
|
||||
<span
|
||||
className={
|
||||
classNames('glitch', 'glitch__common__separator', className)
|
||||
}
|
||||
{...others}
|
||||
role='separator'
|
||||
/> // Contents provided via CSS.
|
||||
) : null;
|
||||
|
||||
// Props.
|
||||
CommonSeparator.propTypes = {
|
||||
className: PropTypes.string,
|
||||
visible: PropTypes.bool,
|
||||
};
|
||||
|
||||
// Export.
|
||||
export default CommonSeparator;
|
||||
15
app/javascript/glitch/components/common/separator/style.scss
Normal file
15
app/javascript/glitch/components/common/separator/style.scss
Normal file
@@ -0,0 +1,15 @@
|
||||
@import 'variables';
|
||||
|
||||
/*
|
||||
The default contents for a separator is an interpunct, surrounded by
|
||||
spaces. However, this can be changed using CSS selectors.
|
||||
*/
|
||||
.glitch.glitch__common__separator {
|
||||
display: inline-block;
|
||||
|
||||
&::after {
|
||||
display: inline-block;
|
||||
padding: 0 .3em;
|
||||
content: "·";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user