Skip to content

Commit

Permalink
PR comments fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinoffers committed Jan 14, 2025
1 parent 221bdd6 commit 1486c93
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 50 deletions.
2 changes: 1 addition & 1 deletion app/components-react/highlighter/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function SettingsView({
style={{ width: 'fit-content' }}
type="primary"
onClick={() => {
HighlighterService.installAiHighlighter(true);
HighlighterService.actions.installAiHighlighter(true);
}}
>
{$t('Install AI Highlighter App')}
Expand Down
35 changes: 35 additions & 0 deletions app/components-react/pages/PlatformAppStore.m.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@import '../../styles/index.less';

.browser-view {
position: absolute;
top: 0;
right: 0;
left: 0;
}

.other-installed-apps-wrapper {
display: flex;
gap: 16px;
position: absolute;
bottom: 0;
height: 72px;
align-items: center;
padding: 8px;
}

.other-app-wrapper {
border-radius: 8px;
border: 1px solid #30383d;
display: flex;
gap: 16px;
padding: 8px;
padding-left: 16px;
justify-content: space-between;
align-items: center;
}

.text-wrapper {
display: flex;
gap: 8px;
align-items: center;
}
35 changes: 6 additions & 29 deletions app/components-react/pages/PlatformAppStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Services } from 'components-react/service-provider';
import { Button } from 'antd';
import { EMenuItemKey } from 'services/side-nav';
import { $t } from 'services/i18n';
import styles from './PlatformAppStore.m.less';

export default function PlatformAppStore(p: { params: { appId?: string; type?: string } }) {
const {
Expand All @@ -22,7 +23,7 @@ export default function PlatformAppStore(p: { params: { appId?: string; type?: s
);
const [platformAppsUrl, setPlatformAppsUrl] = useState('');
const [currentUrl, setCurrentUrl] = useState<string>('');
const browser = useRef<any>(null);

useEffect(() => {
async function getPlatformAppsUrl() {
const url = await UserService.views.appStoreUrl(p.params);
Expand Down Expand Up @@ -84,11 +85,8 @@ export default function PlatformAppStore(p: { params: { appId?: string; type?: s
return (
<>
<BrowserView
className={styles.browserView}
style={{
position: 'absolute',
top: 0,
right: 0,
left: 0,
height: `calc(100% - ${
currentUrl.includes('installed-apps') &&
HighlighterService.views.highlighterVersion !== ''
Expand All @@ -104,31 +102,10 @@ export default function PlatformAppStore(p: { params: { appId?: string; type?: s
}}
/>
{currentUrl.includes('installed-apps') && highlighterInstalled && (
<div
style={{
display: 'flex',
gap: '16px',
position: 'absolute',
bottom: 0,
height: '72px',
alignItems: 'center',
padding: '8px',
}}
>
<div className={styles.otherInstalledAppsWrapper}>
<div>{$t('Other installed apps:')}</div>
<div
style={{
borderRadius: 8,
border: '1px solid #30383D',
display: 'flex',
gap: '16px',
padding: '8px',
paddingLeft: '16px',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
<div className={styles.otherAppWrapper}>
<div className={styles.textWrapper}>
<h3 style={{ margin: 0 }}>AI Highlighter</h3>
<p style={{ opacity: 0.3, margin: 0 }}>by Streamlabs</p>
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/components-react/shared/BrowserView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ export default function BrowserView(p: BrowserViewProps) {

function getCurrentUrl() {
if (!browserView.current) {
console.log('BrowserView: browserView.current is null');
return '';
}
return browserView.current!.webContents.getURL();
return browserView.current.webContents.getURL();
}

return (
Expand Down
9 changes: 9 additions & 0 deletions app/components-react/windows/settings/InstalledApps.m.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@
margin-right: 0;
}
}

.ai-highlighter-thumbnail {
width: 50px;
height: 32px;
display: grid;
place-content: center;
background: linear-gradient(60deg, #2de8b0 25.56%, #cbe953 60.27%, #ffab48 79.52%, #ff5151 96.69%),
#fff;
}
11 changes: 1 addition & 10 deletions app/components-react/windows/settings/InstalledApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,7 @@ export default function InstalledApps() {
{highlighterVersion !== '' && (
<tr key={'Ai Highlighter'}>
<td>
<div
style={{
width: '50px',
height: '32px',
display: 'grid',
placeContent: 'center',
background:
'linear-gradient(60deg, #2DE8B0 25.56%, #CBE953 60.27%, #FFAB48 79.52%, #FF5151 96.69%), #FFF',
}}
>
<div className={styles.aiHighlighterThumbnail}>
<i
style={{ margin: 0, fontSize: '20px', color: 'black' }}
className="icon-highlighter"
Expand Down
10 changes: 2 additions & 8 deletions app/services/highlighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,6 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt
this.state.highlighterVersion = version;
}

@mutation()
UNINSTALL_HIGHLIGHTER() {
// TODO: Actually deinstall highlighter, then set
this.state.highlighterVersion = '';
}

get views() {
return new HighlighterViews(this.state);
}
Expand Down Expand Up @@ -1240,14 +1234,14 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt
await this.aiHighlighterUpdater.isNewVersionAvailable();
this.startUpdater();
} else {
// Only for go live view to immediately show the toggle. For other flow updater will set the version
// Only for go live view to immediately show the toggle. For other flows, the updater will set the version
this.SET_HIGHLIGHTER_VERSION('0.0.0');
}
}

async uninstallAiHighlighter() {
this.setAiHighlighter(false);
this.UNINSTALL_HIGHLIGHTER();
this.SET_HIGHLIGHTER_VERSION('');

await this.aiHighlighterUpdater?.uninstall();
}
Expand Down

0 comments on commit 1486c93

Please sign in to comment.