         button.accessibilityHint = WMFLocalizedString("table-of-contents-close-accessibility-hint", value:"Close", comment:"Accessibility hint for closing table of contents\n{{Identical|Close}}")
         button.accessibilityLabel = WMFLocalizedString("table-of-contents-close-accessibility-label", value:"Close Table of contents", comment:"Accessibility label for closing table of contents")
 
+        button.translatesAutoresizingMaskIntoConstraints = false
+
         return button
     }()
+
+    var closeButtonTrailingConstraint: NSLayoutConstraint?
+    var closeButtonLeadingConstraint: NSLayoutConstraint?
+    var closeButtonTopConstraint: NSLayoutConstraint?
+    var closeButtonBottomConstraint: NSLayoutConstraint?
 
     lazy var backgroundView :UIVisualEffectView = {
         let view = UIVisualEffectView(frame: CGRect.zero)

import UIKit
import Masonry

// MARK: - Delegate
@objc public protocol WMFTableOfContentsPresentationControllerTapDelegate {

    }

    func updateButtonConstraints() {
        switch self.displaySide {
        case .right:
            fallthrough
        case .left:
            closeButtonLeadingConstraint?.isActive = false
            closeButtonBottomConstraint?.isActive = false
            closeButtonTrailingConstraint?.isActive = true
            closeButtonTopConstraint?.isActive = true
            break
        case .center:
            fallthrough
        default:
            closeButtonTrailingConstraint?.isActive = false
            closeButtonTopConstraint?.isActive = false
            closeButtonLeadingConstraint?.isActive = true
            closeButtonBottomConstraint?.isActive = true
        }
        return ()
    }

    
