File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 53
53
& :not (.mdc-tab--active ) .mdc-tab__text-label {
54
54
color : var (--mdc-theme-on-surface );
55
55
}
56
+ .mdc-tab__ripple :hover ::before {
57
+ opacity : 0.5 ;
58
+ }
59
+ .mdc-tab__ripple.mdc-ripple-upgraded--background-focused ::before {
60
+ opacity : 0.5 ;
61
+ }
56
62
}
57
63
}
Original file line number Diff line number Diff line change @@ -48,12 +48,18 @@ export const AppBar: React.FC<React.PropsWithChildren<Props>> = ({
48
48
</ Tab >
49
49
) ) ;
50
50
51
- const activeTabIndex = navRoutes . findIndex ( ( r ) =>
52
- matchPath ( location . pathname , {
53
- path : r . path ,
54
- exact : r . exact ,
55
- } )
56
- ) ;
51
+ const [ activeTabIndex , setActiveTab ] = React . useState ( 0 ) ;
52
+
53
+ React . useEffect ( ( ) => {
54
+ setActiveTab (
55
+ navRoutes . findIndex ( ( r ) =>
56
+ matchPath ( location . pathname , {
57
+ path : r . path ,
58
+ exact : r . exact ,
59
+ } )
60
+ )
61
+ ) ;
62
+ } , [ location . pathname , navRoutes ] ) ;
57
63
58
64
return (
59
65
< ThemeProvider
@@ -73,7 +79,11 @@ export const AppBar: React.FC<React.PropsWithChildren<Props>> = ({
73
79
</ Typography >
74
80
</ div >
75
81
</ div >
76
- < TabBar theme = "onSurface" activeTabIndex = { activeTabIndex } >
82
+ < TabBar
83
+ theme = "onSurface"
84
+ activeTabIndex = { activeTabIndex }
85
+ onActivate = { ( evt ) => setActiveTab ( evt . detail . index ) }
86
+ >
77
87
{ tabs }
78
88
</ TabBar >
79
89
</ TopAppBar >
Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ const root = createRoot(container!);
58
58
// https://github.com/remix-run/react-router/issues/7870
59
59
root . render (
60
60
< RMWCProvider
61
- // Globally disable ripples
62
- ripple = { false }
63
61
typography = { {
64
62
/** Make headline3 <h3> instaed of div or span */
65
63
headline3 : 'h3' ,
You can’t perform that action at this time.
0 commit comments