Skip to content

Commit a0e69c4

Browse files
committed
convert to react
1 parent 7811f6d commit a0e69c4

File tree

7 files changed

+269
-277
lines changed

7 files changed

+269
-277
lines changed

resources/css/bem/store-slider.less

+5-8
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,15 @@
7676
text-align: center;
7777
border-radius: 10px;
7878

79-
.js-store--disabled & {
79+
&--active {
80+
background-color: @osu-colour-pink-1;
81+
}
82+
83+
&--disabled {
8084
background-color: @osu-colour-b1;
8185
pointer-events: none;
8286
cursor: default;
8387
}
84-
85-
&.js-slider-preset--active {
86-
background-color: @osu-colour-pink-1;
87-
.js-store--disabled & {
88-
background-color: @osu-colour-b1;
89-
}
90-
}
9188
}
9289

9390
&__presets {

resources/js/core-legacy/store-supporter-tag.tsx

-189
This file was deleted.

resources/js/main.coffee

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import PostPreview from 'core-legacy/post-preview'
3232
import Search from 'core-legacy/search'
3333
import StickyFooter from 'core-legacy/sticky-footer'
3434
import { StoreCheckout } from 'core-legacy/store-checkout'
35-
import StoreSupporterTag from 'core-legacy/store-supporter-tag'
3635
import SyncHeight from 'core-legacy/sync-height'
3736
import TooltipDefault from 'core-legacy/tooltip-default'
3837
import TwitchPlayer from 'core-legacy/twitch-player'
@@ -61,7 +60,7 @@ $(document).on 'submit', 'form', (e) ->
6160

6261
$(document).on 'turbolinks:load', ->
6362
BeatmapPack.initialize()
64-
StoreSupporterTag.initialize()
63+
# StoreSupporterTag.initialize()
6564
StoreCheckout.initialize()
6665

6766
# ensure currentUser is updated early enough.

resources/js/register-components.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ import core from 'osu-core-singleton';
2525
import QuickSearch from 'quick-search/main';
2626
import QuickSearchWorker from 'quick-search/worker';
2727
import * as React from 'react';
28+
import StoreSupporterTag from 'store/store-supporter-tag';
2829
import { parseJson } from 'utils/json';
2930
import { mapBy } from 'utils/map';
31+
import { getInt } from 'utils/math';
3032

3133
function reqJson<T>(input: string|undefined): T {
3234
// This will throw when input is missing and thus parsing empty string.
@@ -106,6 +108,15 @@ core.reactTurbolinks.register('ranking-variant-filter', () => (
106108
<RankingVariantFilter {...parseJson('json-variant-filter')} />
107109
));
108110

111+
core.reactTurbolinks.register('store-supporter-tag', (container) => {
112+
const productId = getInt(container.dataset.productId);
113+
if (productId == null) {
114+
throw new Error('missing productId');
115+
}
116+
117+
return <StoreSupporterTag productId={productId} />;
118+
});
119+
109120
core.reactTurbolinks.register('user-card', (container) => (
110121
<UserCard
111122
modifiers={reqJson(container.dataset.modifiers ?? 'null')}

0 commit comments

Comments
 (0)