diff --git a/src/common/Addon/Addon.js b/src/common/Addon/Addon.js index b711c7cb8..61b492053 100644 --- a/src/common/Addon/Addon.js +++ b/src/common/Addon/Addon.js @@ -4,6 +4,8 @@ import classnames from 'classnames'; import Icon from 'stremio-icons/dom'; import styles from './styles'; +const MAX_DESCRIPTION_SYMBOLS = 500; + const renderName = (name) => { if (name.length === 0) { return null; @@ -42,7 +44,7 @@ const renderDescription = (description) => { } return ( -
{description}
+
{description.length > MAX_DESCRIPTION_SYMBOLS ? description.slice(0, MAX_DESCRIPTION_SYMBOLS) + '...' : description}
); } @@ -64,28 +66,26 @@ const renderUrls = (urls) => { const Addon = (props) => { return ( -
-
-
- +
+
+ +
+
+
+ {renderName(props.name)} + {renderVersion(props.version)}
-
-
- {renderName(props.name)} - {renderVersion(props.version)} -
+
+ {renderType(props.types)} + {renderDescription(props.description)} + {renderUrls(props.urls)} +
+
+ + SHARE ADD-ON
- {renderType(props.types)} - {renderDescription(props.description)} - {renderUrls(props.urls)} -
-
- - SHARE ADD-ON -
-
- {props.isInstalled ? 'Install' : 'Uninstall'} -
+
+ {props.isInstalled ? 'Install' : 'Uninstall'}
diff --git a/src/common/Addon/styles.less b/src/common/Addon/styles.less index 75d5098b1..1032f8c53 100644 --- a/src/common/Addon/styles.less +++ b/src/common/Addon/styles.less @@ -1,195 +1,189 @@ @import 'stremio-colors'; @addon-width: 514px; -@addon-padding: 18px; @logo-width: floor((@addon-width * 0.2)); -.addon-container { - width: (@addon-width + (2 * @addon-padding)); - padding: @addon-padding; +.addon { + width: @addon-width; + grid-template-rows: floor((@logo-width * 0.25)) floor((@logo-width * 0.20)) auto auto ceil((@addon-width * 0.08)); - .addon { - width: @addon-width; - grid-template-rows: floor((@logo-width * 0.25)) floor((@logo-width * 0.20)) auto auto ceil((@addon-width * 0.08)); + .logo { + width: @logo-width; + height: @logo-width; + } - .logo { - width: @logo-width; - height: @logo-width; - } + .name { + font-size: 20px; + } - .name { - font-size: 20px; - } + .type { + font-size: 12px; + } - .type { - font-size: 12px; - } + .description { + font-size: 12px; + } - .description { - font-size: 12px; - } + .urls-container { + font-size: 12px; + } - .urls-container { - font-size: 12px; - } + .button { + border-width: 2px; - .button { - border-width: 2px; - - .label { - font-size: 14px; - } + .label { + font-size: 14px; } } } -.addon-container { +.addon { + display: grid; + padding: 2%; background-color: @colorglass; + grid-template-columns: 1fr 4fr; + grid-template-areas: + "logo header" + "logo type" + "logo description" + "urls urls" + "buttons buttons"; - .addon { - display: grid; - grid-template-columns: 1fr 4fr; - grid-template-areas: - "logo header" - "logo type" - "logo description" - "urls urls" - "buttons buttons"; + .logo-container { + grid-area: logo; - .logo-container { - grid-area: logo; - - .logo { - padding: 20%; - fill: @colorwhite; - background-color: @colordarkest; - } + .logo { + padding: 20%; + fill: @colorwhite; + background-color: @colordarkest; } + } - .header-container { - grid-area: header; + .header-container { + grid-area: header; + display: flex; + align-items: center; + overflow: hidden; + padding-left: 4%; + + .header { + width: 100%; display: flex; - align-items: center; - overflow: hidden; - padding-left: 4%; + align-items: baseline; - .header { - width: 100%; - display: flex; - align-items: baseline; - - .name { - max-width: 80%; - margin-right: 3%; - color: @colorwhite; - overflow: hidden; - white-space: pre; - text-overflow: ellipsis; - } - - .version { - flex: 1; - color: @colorwhite60; - overflow: hidden; - white-space: pre; - text-overflow: ellipsis; - } + .name { + max-width: 80%; + margin-right: 3%; + color: @colorwhite; + overflow: hidden; + white-space: pre; + text-overflow: ellipsis; } - } - .type { - grid-area: type; - display: flex; - align-items: center; - padding-left: 4%; - color: @coloraccent; - } - - .description { - grid-area: description; - padding-left: 4%; - color: @colorwhite; - } - - .urls-container { - grid-area: urls; - padding: 4% 0%; - overflow: auto; - word-break: break-all; - - .url { + .version { + flex: 1; color: @colorwhite60; + overflow: hidden; + white-space: pre; + text-overflow: ellipsis; } } + } - .buttons { - grid-area: buttons; + .type { + grid-area: type; + display: flex; + align-items: center; + padding-left: 4%; + color: @coloraccent; + } + + .description { + grid-area: description; + padding-left: 4%; + color: @colorwhite; + word-break: break-all; //Firefox doesn't support { break-word } + word-break: break-word; + } + + .urls-container { + grid-area: urls; + padding: 4% 0%; + overflow: auto; + word-break: break-all; + + .url { + color: @colorwhite60; + } + } + + .buttons { + grid-area: buttons; + display: flex; + align-items: stretch; + justify-content: space-between; + + .button { + width: 46%; + cursor: pointer; display: flex; - align-items: stretch; - justify-content: space-between; + align-items: center; + justify-content: center; + border-style: solid; - .button { - width: 46%; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - border-style: solid; + .icon { + width: 7%; + margin-right: 2%; + } + + .label { + color: @colorwhite; + } + + &.share-button { + border-color: @coloraccent; .icon { - width: 7%; - margin-right: 2%; + fill: @coloraccent; } .label { - color: @colorwhite; - } - - &.share-button { - border-color: @coloraccent; - - .icon { - fill: @coloraccent; - } - - .label { - color: @coloraccent; - } - - &:hover { - background-color: @coloraccent; - - .icon { - fill: @colorwhite; - } - - .label { - color: @colorwhite; - } - } - } - - &.install-button { - border-color: @colorsignal5; - background-color: @colorsignal5; - - &:hover { - background-color: @colorsignal580; - } - } - - &.uninstall-button { - border-color: @colorneutral; - - &:hover { - background-color: @colorneutral; - } + color: @coloraccent; } &:hover { - border: none; + background-color: @coloraccent; + + .icon { + fill: @colorwhite; + } + + .label { + color: @colorwhite; + } } } + + &.install-button { + border-color: @colorsignal5; + background-color: @colorsignal5; + + &:hover { + background-color: @colorsignal580; + } + } + + &.uninstall-button { + border-color: @colorneutral; + + &:hover { + background-color: @colorneutral; + } + } + + &:hover { + border: none; + } } } } \ No newline at end of file diff --git a/src/common/Stream/styles.less b/src/common/Stream/styles.less index 6c3cb71ea..9b1bc5bda 100644 --- a/src/common/Stream/styles.less +++ b/src/common/Stream/styles.less @@ -1,7 +1,7 @@ @import 'stremio-colors'; @stream-width: 360px; -@spacing: min(12px, ceil((@stream-width * 0.04))); +@spacing: max(12px, ceil((@stream-width * 0.04))); @progress-height: 5px; .stream-container { @@ -68,6 +68,7 @@ display: flex; align-items: center; color: @colorwhite; + word-break: break-all; //Firefox doesn't support { break-word } word-break: break-word; } diff --git a/src/common/Video/styles.less b/src/common/Video/styles.less index 606e3695e..5ea778361 100644 --- a/src/common/Video/styles.less +++ b/src/common/Video/styles.less @@ -1,7 +1,7 @@ @import 'stremio-colors'; @video-width: 360px; -@spacing: min(8px, ceil((@video-width * 0.02))); +@spacing: max(8px, ceil((@video-width * 0.02))); @progress-height: 5px; .video-container { @@ -70,6 +70,7 @@ .title { color: @colorwhite; + word-break: break-all; //Firefox doesn't support { break-word } word-break: break-word; } diff --git a/stories/index.stories.js b/stories/index.stories.js index 0396332f2..69da5b333 100644 --- a/stories/index.stories.js +++ b/stories/index.stories.js @@ -45,7 +45,7 @@ storiesOf('Addon', module) version={'1.3.0'} isInstalled={true} types={['Channels', 'Videos']} - description={'Watch your favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notified when they upload new videos.'} + description={'Watch your favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiourfavourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiourfavourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notiour favourite YouTube channels ad-free and get notified when they upload new videos.'} urls={['https://channels.strem.io/stremioget/stremio/v1', 'https://channels.strem.io/stremioget/stremio/v1']} />
@@ -226,9 +226,9 @@ storiesOf('Video', module)