diff --git a/src/App.js b/src/App.js index ec7dca9..737fdf7 100644 --- a/src/App.js +++ b/src/App.js @@ -12,7 +12,7 @@ class App extends Component { this.state = { state: null, }; - localforage.getItem("loginData").then((login) => { + localforage.getItem("login").then((login) => { if (login) { this.loginData = login; this.setState({ state: "matrix" }); diff --git a/src/Avatar.js b/src/Avatar.js new file mode 100644 index 0000000..2b780d0 --- /dev/null +++ b/src/Avatar.js @@ -0,0 +1,35 @@ +import { Component } from "inferno"; + +const presenceColor = { + online: "green", + offline: "gray", + unavailable: "orange", +}; + +class Avatar extends Component { + render() { + return ( +
{"Rooms not implemented"}
+{"Invites are not implemented and auto accepted"}
+{"Settings not implemented"}
+{"About info coming soon..."}
+{createTextVNode(randomTip())}
> ); } diff --git a/src/adrianavatar.png b/src/adrianavatar.png new file mode 100644 index 0000000..d69dedc Binary files /dev/null and b/src/adrianavatar.png differ diff --git a/src/farooqlogo.png b/src/farooqlogo.png new file mode 100644 index 0000000..d946a46 Binary files /dev/null and b/src/farooqlogo.png differ diff --git a/src/morecolor.scss b/src/morecolor.scss new file mode 100644 index 0000000..4690d58 --- /dev/null +++ b/src/morecolor.scss @@ -0,0 +1,7 @@ +@import "KaiUI/src/theme/theme.scss"; + +$item-bg-focus-color: var(--color-carrotorange); + +:export { + item_bg_focus_color: $item-bg-focus-color; +} diff --git a/src/person_icon.png b/src/person_icon.png new file mode 100644 index 0000000..0dfcc9c Binary files /dev/null and b/src/person_icon.png differ diff --git a/src/ui/IconListItem.js b/src/ui/IconListItem.js index da276c3..62085a4 100644 --- a/src/ui/IconListItem.js +++ b/src/ui/IconListItem.js @@ -4,41 +4,16 @@ import "KaiUI/src/components/IconListItem/IconListItem.scss"; import morecolor from "../morecolor.scss"; const prefixCls = "kai-il"; +const lineCls = `${prefixCls}-line`; +const itemCls = prefixCls; +const primaryCls = `${prefixCls}-line`; class IconListItem extends Component { constructor(props) { super(props); - const { - primary, - secondary, - icon, - iconSrc, - focusClass, - iconWidth, - disabled, - className, - onClick, - } = props; - this.primary = primary; - this.secondary = secondary; - this.itemCls = prefixCls; - this.lineCls = `${prefixCls}-line`; - this.primaryCls = `${this.primaryCls}-primary`; - this.secondaryCls = `${prefixCls}-secondary ${secondary ? "" : "hidden"}`; - this.disabledCls = disabled ? `${prefixCls}-disabled` : ""; - this.disabled = disabled; - this.className = className; - this.focusClass = focusClass; - this.handleClick = onClick; - if (iconSrc) - this.renderedIcon = ; - else if (icon instanceof String && icon.startsWith("kai")) - this.renderedIcon = ( - - ); - // Then we assume it is a valid element TODO: check for this - else this.renderedIcon = {icon}; - this.divRef = createRef(); + this.secondaryCls = `${prefixCls}-secondary ${props.secondary ? "" : "hidden"}`; + this.disabledCls = props.disabled ? `${prefixCls}-disabled` : ""; + this.divRef = createRef(); } componentDidUpdate(lastProps, lastState) { @@ -53,17 +28,26 @@ class IconListItem extends Component { const iconCls = `${prefixCls}-icon-${ this.props.isFocused ? "focused" : "unfocused" }`; + let renderedIcon; + if (this.props.iconSrc) + renderedIcon = ; + else if (this.props.icon instanceof String && this.props.icon.startsWith("kai")) + renderedIcon = ( + + ); + // Then we assume it is a valid element TODO: check for this + else renderedIcon = {this.props.icon}; return (